DevDuck Posted May 19, 2017 Report Posted May 19, 2017 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 CodeIs it possible to catch this event? Or how to avoid errors when restart? Quote
Dr. McKay Posted May 20, 2017 Report Posted May 20, 2017 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. Quote
DevDuck Posted May 20, 2017 Author Report Posted May 20, 2017 (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: And in the group: 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 May 20, 2017 by DevDuck Quote
Dr. McKay Posted May 21, 2017 Report Posted May 21, 2017 I honestly have no idea what you're asking. The statistics in Steam groups aren't always up-to-date or correct. Quote
DevDuck Posted May 21, 2017 Author Report Posted May 21, 2017 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. Quote
DevDuck Posted May 21, 2017 Author Report Posted May 21, 2017 (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! 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 May 21, 2017 by DevDuck Quote
Dr. McKay Posted May 21, 2017 Report Posted May 21, 2017 You probably never called setPersona on the node-steam-user to set it online. Quote
African Posted May 21, 2017 Report Posted May 21, 2017 I'm interested in this. My bot is needing the Steam Guard Code to log in even though I'm using the steam-totp how you are. Quote
DevDuck Posted May 22, 2017 Author Report Posted May 22, 2017 (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 May 22, 2017 by DevDuck Quote
Dr. McKay Posted May 23, 2017 Report Posted May 23, 2017 Does it appear as online/in-game on its direct profile? Quote
DevDuck Posted May 23, 2017 Author Report Posted May 23, 2017 (edited) Does it appear as online/in-game on its direct profile?Yes. Moreover in GetPlayerSummaries: ... "personastate": 1, ... "gameid": "730" Edited May 23, 2017 by DevDuck DevDuck 1 Quote
DevDuck Posted May 26, 2017 Author Report Posted May 26, 2017 Does it appear as online/in-game on its direct profile?Can you help? 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.