Jump to content
McKay Development

Disconnected


bossikkk

Recommended Posts

Hey. I need help. My bot is randomly or after spamming Session Expired will be disconnect. At the same time internet-connection is stable. Why is this happening?

Logs: http://ibb.co/gvnUyR     http://ibb.co/hnA2k6

 

Code:

 

community.on('sessionExpired', function (err) {
    console.log("## Session Expired, relogging.");
    client.webLogOn();
​});

 

setInterval(function () {
    count++;
    console.log("## Session: " + count + ", relogging...");
    client.webLogOn();
},  10 * 60 * 1000);

 

client.on('disconnected', function (eresult) {
    console.log("Disconnected from Steam. Reason '"+SteamUser.EResult[eresult]+" ["+eresult+]'");
});

 

client.on('webSession', function (sessionID, cookies) {
    manager.setCookies(cookies, function (err) {
        if (err) {
            console.log(err);
            process.exit(1);
        } else {  
            community.setCookies(cookies); 
            community.chatLogon();
            inv.getInventory(client.steamID).then(inventory => {
                currentInventory = inventory;
                client.gamesPlayed("B: " + (1000 - Object.keys(currentInventory).length) + " ? " + config.prices.buying_price + " руб | S: " 
                                    + Object.keys(currentInventory).length + " ? " + config.prices.selling_price + " руб");
            })
            .catch(err => {
                console.log(err);
            });
        }
    });
});

 

Link to comment
Share on other sites

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...