Steam bot not logging in due to "Logged in from another location"

23 views Asked by At

I have a script that was supposed to login to steam and then collect the float values of CS2 skins using some code that I haven't written yet. While trying to login via script it will send me a email that it logged in from another location with a Code, but I got no where to put that code. This leaves me stuck

I tried running the Script and then getting the code and manually putting it in the code, but that didn't work out. I also tried looking around on google, but couldn't find anything. The account is 30Days old and was made in another country, but I don't think that should change the fact that I would still need a code when it's logged on from another device or location.

steamClient.on('logOnResponse', (logonResp) => {
    console.log("Received logon response:", logonResp);
    if (logonResp.eresult === Steam.EResult.OK) {
        console.log("Steam is ready.");
        // You can implement further actions here after successful login
    } else if (logonResp.eresult === Steam.EResult.AccountLogonDenied) {
        console.log("Steam Guard code required. Check your email or mobile app.");
        rl.question('Enter Steam Guard code: ', (guardCode) => {
            console.log("Entered Steam Guard code:", guardCode);
            steamUser.logOn({
                account_name: STEAM_USERNAME,
                password: STEAM_PASSWORD,
                auth_code: guardCode
            });
        });
    } else {
        console.log("Failed to log in to Steam:", logonResp);
        // Handle failed login
        console.log("Retrying login in 30 seconds...");
        setTimeout(connectToSteam, LOGIN_DELAY);
    }
});

Error: Steam Guard code required. Check your email or mobile app. Steam client error: Error: Disconnected

0

There are 0 answers