Jump to content
McKay Development
Sign in to follow this  
DLC-EM_exchangebot

Online to Offline status after a few hours

Recommended Posts

I noticed my bots go from online(in custom game, using client.gamesPlayed) to offline status after a few hrs.
it can still receive messages and recognizes the commands and all,  it still functions as it should be even tho it's in offline status
it still processes any trades being sent to it
I even added a setInterval function for client.gamesPlayed every 1 hr and when it goes offline, I wait for the interval to refresh the client.gamesPlayed part and it doesn't work

Share this post


Link to post
Share on other sites

If Steam forgot you were in-game, you wouldn't go offline; you'd go online but not in-game. You probably want to try calling setPersona in your interval instead.

That said, I've never experienced this. Can you show the code in your loggedOn event?

Share this post


Link to post
Share on other sites

here sir


function login(err) {
 if (err) {
  return process.exit(5);
 }
 client.on('loggedOn', function() {
  return client.setPersona(1, account.botDisplayName)
}

should I replace my client.gamesPlayed in my interval? or should I call setPersona first before calling client.gamesPlayed

Share this post


Link to post
Share on other sites

That code as written should work, but:

  1. It looks like you'll be adding a new loggedOn listener every time you call login. That's not a problem if login is only called once, but I kind of doubt that's the case from this snippet.
  2. That return statement isn't doing anything.
  3. It's not necessary to pass your desired persona name every time. If you don't pass any name, Steam won't change your name.
  4. It's recommended to reference the enums rather than using the literal value. So in this case, client.setPersona(SteamUser.EPersonaState.Online)
  5. Where do you call gamesPlayed()?

Share this post


Link to post
Share on other sites

function login(err) {
 if (err) {
  return process.exit(5);
 } else {
  client.on('loggedOn', function() {
   client.setPersona(1, account.botDisplayName)
  });
  client.gamesPlayed("some strings here")
 }
}

setInterval(() => {
 client.gamesPlayed("some strings here")
}, 1000 * 60 * 60)

 

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...