CellSplitter Posted October 30, 2021 Report Posted October 30, 2021 Hey, i will idle my Gamehours from my main Acc without loosing my Mobile Confirmation. i start it via Message from a second Account (Command + right 2fa Code like "!boost KH54E") if the 2fa Code right, it works good, but if it wrong it fires a Command Prompt to Console "Steam Guard App Code:" ...but i run this Bot via PM2 and i cant set the right 2fa Code in the Console. MY CODE: (snippet) } else if (MSG.toUpperCase().indexOf("!BOOST") >= 0) { let n = MSG.toUpperCase().replace("!BOOST", "").toString(); let IdleLogOnOptions = { accountName: CONFIG.IdleAccount.USERNAME, password: CONFIG.IdleAccount.PASSWORD, twoFactorCode: n }; IdleClient.logOn(IdleLogOnOptions); IdleClient.on("loggedOn", function() { IdleClient.getPersonas([IdleClient.steamID], (personas) => { sleep(1000).then(() => { console.log("[" + getTime() + "] [INFO] [IdleClient] Login successfully!"); IdleClient.setPersona(SteamUser.Steam.EPersonaState.Online); IdleClient.gamesPlayed(730); online++ }); }); }); sleep(2000).then(() => { if ( online === 1) { client.chatMessage(SENDER, "✅ IdleClient successfully Login!"); } else { client.chatMessage(SENDER, "⛔ You don't set the right 2FA Code!"); }; }); Can i handle it that the Bot gives me only the Message back that i set the wrong 2fa Code without fires the Command Prompt, so i can try it again with the right Code? Quote
Dr. McKay Posted November 2, 2021 Report Posted November 2, 2021 https://github.com/DoctorMcKay/node-steam-user#steamguard CellSplitter 1 Quote
CellSplitter Posted November 2, 2021 Author Report Posted November 2, 2021 (edited) Hey thank You for your Answer, i found this too today and i solve my Problem. // => IdleClient on/off Switch let online = 0; // Only a SNIPPET from my Chat Commands } else if(CONFIG.OWNER.indexOf(SENDER.getSteamID64()) >= 0 || CONFIG.OWNER.indexOf(parseInt(SENDER.getSteamID64())) >= 0) { // Admin Chat Commands if (MSG.toUpperCase().indexOf("!ONIDLE") >= 0) { let n = MSG.toUpperCase().replace("!ONIDLE ", "").toString(); IdleClient.setOption("promptSteamGuardCode", false); let IdleLogOnOptions = { accountName: CONFIG.IdleAccount.USERNAME, password: CONFIG.IdleAccount.PASSWORD, twoFactorCode: n }; IdleClient.logOn(IdleLogOnOptions); IdleClient.on("steamGuard", function(domain, lastCodeWrong) { if(lastCodeWrong) { sleep(1000).then(() => { client.chatMessage(SENDER, "⛔ You don't set the right SteamGuard Code!"); }); } }); IdleClient.on("loggedOn", function() { IdleClient.getPersonas([IdleClient.steamID], (personas) => { IdleClient.setPersona(SteamUser.Steam.EPersonaState.Online); IdleClient.gamesPlayed(CONFIG.IdleAccount.IDLEGAMES); }); console.log("[" + getTime() + "] [INFO] [IdleClient] Login successfully!"); sleep(1000).then(() => { client.chatMessage(SENDER, "✅ IdleClient Login successfully!"); }); online = 1; }); } else if(MSG.toUpperCase() === "!OFFIDLE") { if (online === 1) { online = 0; IdleClient.logOff(); sleep(1000).then(() => { client.chatMessage(SENDER, "✅ IdleClient Logout successfully!"); }); } else { sleep(1000).then(() => { client.chatMessage(SENDER, "⛔ IdleClient not running!"); }); }; Works like a Charm now, iam happy :-) EDIT: I don't know why this editor shows the code a bit shifted?! Edited November 2, 2021 by CellSplitter Quote
Dr. McKay Posted November 3, 2021 Report Posted November 3, 2021 The promptSteamGuardCode option was removed in v4. The prompting is now automatically disabled when you add a steamGuard event listener. The arguments for the steamGuard event are domain, callback, lastCodeWrong. With the code you pasted, lastCodeWrong will always be truthy because that's actually the callback you should call with your new code. Quote
CellSplitter Posted November 3, 2021 Author Report Posted November 3, 2021 (edited) I use Version 3.29.3 from steam-user and there works this Code very well SteamGuard event fires only lastcodewrong if the Code is wrong otherwise not. I give him the Code over client.LogOn via TwoFactorCode But will check options from a newer Version Thx... Edited November 3, 2021 by CellSplitter Quote
Dr. McKay Posted November 5, 2021 Report Posted November 5, 2021 The arguments are still domain, callback, lastCodeWrong on 3.29.3 as well. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.