dawe Posted Tuesday at 03:34 PM Report Share Posted Tuesday at 03:34 PM Hello! How do I keep the bot logged in? It logs out after a while. Do I just use this: this.client.setOption('autoRelogin', true); Appearently you should use webLogOn() in the code, but how? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted Tuesday at 06:43 PM Report Share Posted Tuesday at 06:43 PM What do you mean by "logged in", exactly? Quote Link to comment Share on other sites More sharing options...
dawe Posted Tuesday at 08:11 PM Author Report Share Posted Tuesday at 08:11 PM 1 hour ago, Dr. McKay said: What do you mean by "logged in", exactly? Logged into steam Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted Tuesday at 08:16 PM Report Share Posted Tuesday at 08:16 PM Logged into the Steam client, or the website? Quote Link to comment Share on other sites More sharing options...
dawe Posted Tuesday at 08:34 PM Author Report Share Posted Tuesday at 08:34 PM Steam client Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted Wednesday at 04:09 AM Report Share Posted Wednesday at 04:09 AM Once you're connected, it'll just stay connected unless Steam goes down or your network goes down. Quote Link to comment Share on other sites More sharing options...
dawe Posted Wednesday at 09:56 AM Author Report Share Posted Wednesday at 09:56 AM What happens is the session expires Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted Wednesday at 05:51 PM Report Share Posted Wednesday at 05:51 PM That's not a thing for CM (Steam client) connections. What's the actual symptom you're seeing? Quote Link to comment Share on other sites More sharing options...
dawe Posted Thursday at 11:03 AM Author Report Share Posted Thursday at 11:03 AM (edited) Ok then I may be in the wrong subforum. The symptom is that the Steam bot gets logged out because the session expires and can't send trades anymore after about 15 hours. Edited Thursday at 05:02 PM by dawe Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted Thursday at 10:28 PM Report Share Posted Thursday at 10:28 PM Right, that's a web session, not a client session. When you log in to the client using steam-user and receive a webSession event, that's a web session that's started through the client. Those web sessions expire independently of the client session, and you do need to call webLogOn() occasionally to get a new web session. Quote Link to comment Share on other sites More sharing options...
Yeezy Posted yesterday at 05:19 AM Report Share Posted yesterday at 05:19 AM On 10/23/2024 at 6:09 AM, Dr. McKay said: Once you're connected, it'll just stay connected unless Steam goes down or your network goes down. It used to reconnect when steam went down right? I think autoRelogin might be broken currently with steam going down. Does the relog function do the same as the autoRelogin option? https://github.com/DoctorMcKay/node-steam-user?tab=readme-ov-file#relog Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted yesterday at 06:48 AM Report Share Posted yesterday at 06:48 AM I'm not aware of autoRelogin being broken in any way. Web sessions are completely independent of CM connections. When steam-user is "connected", that's a CM session. A web session is negotiated through the CM session, but they're entirely separate. Web sessions are never automatically renewed by steam-user; that responsibility falls onto you. Quote Link to comment Share on other sites More sharing options...
dawe Posted yesterday at 12:17 PM Author Report Share Posted yesterday at 12:17 PM (edited) Thank you for your help, much appreciated. Would this work: this.community.on("sessionExpired", async function (err) { if (err) { console.log('Session Expired: ' + err); } self.client.webLogOn(); console.log('called weblogon'); }); Edited yesterday at 12:23 PM by dawe Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted yesterday at 07:52 PM Report Share Posted yesterday at 07:52 PM Yes, that should work. I'd recommend some debouncing to ensure that you don't spam-call webLogOn if multiple sessionExpired events are emitted quickly. Quote Link to comment Share on other sites More sharing options...
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.