Jump to content
McKay Development

Still asking for guard after 5 minutes?


Recommended Posts

Posted

Hey!

So I tried making a bot, that would run 24/7 and when he gets kicked off the account (I'm playing smth) it will wait random delay, and try to relog.

This is my code for handling the disconnect and errors:

user.on('error', (err) => {
    log(`${err}`, 'err');
    if(err == 'Error: LoggedInElsewhere') return relogAfterDelay();
});
user.on('disconnected', (resultCode, message) => {
    const error = enums.EResult[resultCode];
    if(error === 'LoggedInElsewhere' || error === 'AlreadyLoggedInElsewhere' || error === 'NotLoggedOn') return relogAfterDelay();
    log(`${loginDetails.accountName} | ${error} | Disconnect message: ${message}`, 'err');
});

And here is my relogAfterDelay function:

function relogAfterDelay(){
    const delay = Math.round(1200000 * Math.random());
    log(`${loginDetails.accountName} | Disconnected! Relogging in ${Math.round(delay/1000)} second(s)!`, 'inf');
    setTimeout(() => {
        log(`Relogging...`, 'inf');
        user.logOn(loginDetails);
    }, delay);
}

These are the logs I got:

11/27/2022 11:24:46 INF Logged in as LOGIN (STEAMID).
11/27/2022 11:24:46 INF Game idle started.
11/27/2022 11:24:48 ERR Error: LoggedInElsewhere
11/27/2022 11:24:48 INF LOGIN | Disconnected! Relogging in 327 second(s)!
11/27/2022 11:30:15 INF Relogging...
Steam Guard App Code:

I've read that if you ask to login in 30 seconds delay from logging in with the guard code you will need to wait/pass next one manually, but as you can see the code waited more than 5 minutes, and it still asked for code.

Posted
8 hours ago, Dr. McKay said:

Every time you login with your password to an account that has mobile 2FA enabled, you'll need to supply a code. It doesn't matter how long you wait.

I have my Shared Secret provided in the login details, so what should I do?

const loginDetails = {
    accountName: `x`,
    password: `x`,
    twoFactorCode: steamTotp.generateAuthCode(`x`),
    rememberPassword: true,
    machineName: 'x',
    clientOS: 20
};

Can the problem be in syntax? I wonder if manually assigning new code to the loginDetails.twoFactorCode like this:

loginDetails.twoFactorCode = steamTotp.generateAuthCode(`x`);
user.logOn(loginDetails);

I'll try that and come back

Well it works, thanks

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...