Jump to content
McKay Development

Recommended Posts

Posted

This is my code:

manager.on('pollSuccess', () => {
    if (!client.steamID) {
        client.logOn(getLogOnOptions());
    }
});

But today some bots did not restart. In the logs I found the following:

Steam Guard App Code

Is it possible to catch this event? Or how to avoid errors when restart?

Posted

If you're using node-steam-user, it will automatically reconnect when it gets disconnected. You can handle the event where you need a Steam Guard code by setting the promptSteamGuardCode option to false and handling the steamGuard event.

Posted (edited)

Thank you. I found the cause. I create an instance of the class:

 

this.csgo = new GlobalOffensive(this.client);


this.manager = new TradeOfferManager({
    'steam'      : this.client,
    'community'  : this.community,
    'domain'     : 'localhost',
    'language'   : 'en'
});

1. In general, in the process, variables this.client and this.community class instance has already been created, there this variable is not changed. What's the right way? To change this property or to re-create the object dynamically?

 

...So, because of this my bot tries to relogin too often and invoked "Steam Guard App Code"...

 

2. And I noticed that the event "disconnected" is not always invoked for some reason

 

3. Hmm... In the opskins group all bots are online and in game... Why my bot is online and in game but in group I have this:

 

My bot:

 

Bk9oFzL.png

 

And in the group:

 

0Jx00i5.png

 

if I restart my bot he gets online for a while and then again offline.

 

Interestingly if I go from the account of the bot and will go to the link https://steamcommunity.com/chat the group will have:

1 IN-GAME and 1 ONLINE ... like some session is updated.. I don't know..

 

Why is this happening?

Edited by DevDuck
Posted

If I check my bot he is online and in game... but If I enter the group, there shows no one online. If I restart the bot in the console or pass authorization on Steam via the username and password then the bot back online (in the group) in a short time.

Posted (edited)

Interesting... :) I ran this code in parallel with working the bot:

const SteamCommunity = require('steamcommunity');
const SteamTotp = require('steam-totp');


const community = new SteamCommunity();


community.login(getLogOnOptions(), (err) => {
    if (!err) community.chatLogon();
});

My bot was offline in the group. After running this code to enter in the chat, bot is online!

 

ubwY18b.png

 

Why is this happening? Maybe I need to periodically log in to the chat to keep the bot as online in the GROUP? Or why?

Edited by DevDuck
Posted (edited)

You probably never called setPersona on the node-steam-user to set it online.

 

No, I use setPersona the event loggedOn: 

this.client.on('loggedOn', () => {
    this.client.setPersona(SteamUser.Steam.EPersonaState.Online);
    this.client.gamesPlayed([730]);
});

 

I told you that immediately after login everything is perfect. But after an hour or two, the bot disappears from the network (in the group), but it network to ellisite in his personal profile.

 

 

Or setPesona need to use is some loop? Like that:

this.manager.on('pollSuccess', () => {
    this.client.setPersona(SteamUser.Steam.EPersonaState.Online);
    this.client.gamesPlayed([730]);
});

How do you maintain state?

 

Update:

 

I did setPersona in loop:

setInterval(() => {    
    this.client.setPersona(SteamUser.Steam.EPersonaState.Online);
    this.client.gamesPlayed([730]);
}, 3600000);

in the end, it didn't help...

 

I think maybe I break the session? Please help me  :(

Edited by DevDuck

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