laroz Posted November 3, 2016 Report Posted November 3, 2016 Hey, much time, when the bot start/restart/crashed it comes Steam Guard App Code: But why? I dont can find this... Is this cause i used with App Guard? "domain": 'MYDOMAIN.com' Quote
Dr. McKay Posted November 3, 2016 Report Posted November 3, 2016 You can only use a code once. Subsequent uses will be rejected. Codes change every 30 seconds. In practice, this means that a second login within a 30-second interval will be rejected and ask for a new code. Quote
laroz Posted November 8, 2016 Author Report Posted November 8, 2016 You can only use a code once. Subsequent uses will be rejected. Codes change every 30 seconds. In practice, this means that a second login within a 30-second interval will be rejected and ask for a new code.But what can i do, if the bot ask for Steam Guard Code:? The Bot dont try again for his own... i must turn off and start again to fix it... Quote
Frost Byte Posted November 8, 2016 Report Posted November 8, 2016 (edited) Alright. I'm not completely sure if this will help you out, but this is what I currently use and it works for me: // Disables asking for Steam Guard Code client.setOption("promptSteamGuardCode", false); // Logs on client.logOn({ "accountName": config.username, "password": config.password }); // If some error occured during logon. Closes the process client.on("error", function (e) { console.log(e); process.exit(1); }); // If last Steam Guard Code was wrong, here a new one is created client.on("steamGuard", function(domain, callback, lastCodeWrong) { if(lastCodeWrong) { console.log("Last code wrong, try again!"); } callback(SteamTotp.generateAuthCode(config.sharedsecret)); }); You will need to use the Steam Desktop Authenticator for this! That can be found here https://github.com/Jessecar96/SteamDesktopAuthenticator Furthermore you need Dr. McKay's node-steam-totp library as well to generate new Steam Guard Codes from the shared_secret.Please do some reasearch about 'shared_secret' and 'identity_secret' and from then on you'll be alright! Edited November 8, 2016 by Frost Byte Quote
Frost Byte Posted November 8, 2016 Report Posted November 8, 2016 You can only use a code once. Subsequent uses will be rejected. Codes change every 30 seconds. In practice, this means that a second login within a 30-second interval will be rejected and ask for a new code. @Dr. McKay Alright, I just had this problem that the last Steam Guard code was wrong and it tried logging into Steam again like 5 times within 2 seconds. Of course this gave me the RateLimitExceeded error. Could I solve this by adding a setTimeOut before the callback? Basically something like this: // If last Steam Guard Code was wrong, here a new one is created client.on("steamGuard", function(domain, callback, lastCodeWrong) { if(lastCodeWrong) { logger.warn("Last code wrong, try again!"); } logger.warn("Waiting 30 seconds for a new Steam Guard code"); setTimeout(callback(SteamTotp.generateAuthCode(config.sharedsecret)), 30000); }); Quote
Dr. McKay Posted November 8, 2016 Report Posted November 8, 2016 Yes, you should set a timeout. The code a couple posts back will just spam Steam with login requests which will get you locked out. That's not how you set a timeout, though. You want this: setTimeout(function() { callback(SteamTotp.generateAuthCode(config.sharedsecret)); }, 30000); Quote
Frost Byte Posted November 8, 2016 Report Posted November 8, 2016 Thanks, that worked once again really well! My code did indeed not work since the callback wasn't a function... I tried to create my own method. function getGuardCode() { return callback(SteamTotp.generateAuthCode(config.sharedsecret)); /* I even tried without return, but that didn't help either */ } setTimeout(getGuardCode(), 30000); But well that didn't work... I know you don't give JavaScript classes, but why does it work when you only have function() { callback(SteamTotp.generateAuthCode(config.sharedsecret)); } Does this 'force' callback to become a function? Or is it like 'Hey, here is now a function. Just use it'? Quote
Dr. McKay Posted November 9, 2016 Report Posted November 9, 2016 Your first code snippet will work if you get rid of the parenthesis. Like this: setTimeout(getGuardCode, 30000); You need to pass setTimeout a function. By adding parenthesis, you're calling the function and passing its return value (undefined) instead of passing it. Quote
laroz Posted November 15, 2016 Author Report Posted November 15, 2016 Thank you guys!That is working client.on("steamGuard", function(domain, callback, lastCodeWrong) { if(lastCodeWrong) { console.log("Last code wrong, try again!"); setTimeout(function() { callback(SteamTotp.getAuthCode("YOURCODE")); }, 30000); } }); I mean this 30 seconds is for Steam Codes, cause this time needs to wait for the new code right? Than close it Working! 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.