dawe Posted October 22 Report Share Posted October 22 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 October 22 Report Share Posted October 22 What do you mean by "logged in", exactly? Quote Link to comment Share on other sites More sharing options...
dawe Posted October 22 Author Report Share Posted October 22 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 October 22 Report Share Posted October 22 Logged into the Steam client, or the website? Quote Link to comment Share on other sites More sharing options...
dawe Posted October 22 Author Report Share Posted October 22 Steam client Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 23 Report Share Posted October 23 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 October 23 Author Report Share Posted October 23 What happens is the session expires Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 23 Report Share Posted October 23 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 October 24 Author Report Share Posted October 24 (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 October 24 by dawe Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 24 Report Share Posted October 24 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 October 25 Report Share Posted October 25 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 October 25 Report Share Posted October 25 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 October 25 Author Report Share Posted October 25 (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 October 25 by dawe Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 25 Report Share Posted October 25 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.