Jump to content
McKay Development

neverhood

Member
  • Posts

    68
  • Joined

Posts posted by neverhood

  1. now I get it (I think so :D), thank you for explaining me
     
    should I add setInterval in 'loggedOn' with 1 hour refresh? something like this:
     
    setInterval(function(){ client.webLogOn(); }, 3600000);
    

    my current code:

     

    client.on('webSession', (sessionID, cookies) => {
      manager.setCookies(cookies);
    
      const f = Object.keys(client.myFriends);
      for (let i = f.length - 1; i >= 0; i--)
        if (client.myFriends[f[i]] === 2)
          client.addFriend(f[i]);
    });
    
    
    client.on('loggedOn', () => {
      client.gamesPlayed(configuration.gamesPlayed);
      client.setPersona(1);
      console.log(`[${new Date().toLocaleTimeString()}] - ONLINE - ${client.steamID.getSteamID64()}`);
    });

    am I setting properly manager cookies with every websession?

     

  2. The way you used community in your first post is correct. You can do just {community} which is interpreted as {community: community}.

     

    I think probably what's happening is that your session is just expiring (which happens normally) and you aren't expecting it. It wouldn't hurt to add an automatic hourly webLogOn call to be more proactive about renewing your session rather than reactive.

     

    I have no idea why this is happening randomly (when someone send trade offer session getting expired 1 second after and my bot stuck), sometimes my bot works even 72 hours without this issue, I think maybe because bot is idling for longer time (not receving any trade offer) this is happening.

  3. Hello, I released some donation/trash bot and most of time everything is working fine, processing a lot of trades without any problems (only accepting gift trades), but lately I got weird problem, session expiring 1 second after new trade

     

    my console logs:

     

    [18:35:09] - Processing trade 3459285622
    [18:35:10] Session expired - relogging
    [21:56:28] - Processing trade 3459471951
    [21:56:29] Session expired - relogging
     
    how I handle it in my bot:
     
    const community = new SteamCommunity();
    const manager = new SteamTradeofferManager({
      steam: client,
      language: 'en',
      community
    });
    
    
    community.on('sessionExpired', () => {
      console.log(`[${new Date().toLocaleTimeString()}] Session expired - relogging`);
      client.webLogOn();
    });

    everything works good, but sometimes getting this error and my bot stuck (should I remove community from manager?)

     

    edit: I noticed I wrongly used community in const manager

  4. I'm using this code on local script now (VPS session is running with diff IP):

     

    bot.setPersona(SteamUser.EPersonaState.Offline);
    bot.gamesPlayed(this.games, true);
    but I'm still getting error on local PC with 'LoggedInElsewhere' and VPS session is untouched, what should I do if I want to kick VPS session during launching my idle scrip on local PC?

     

     

    I edited something for test and force is undefined in console log

     

    SteamUser.prototype.gamesPlayed = function(apps, force) {
    	if (!(apps instanceof Array)) {
    		apps = [apps];
    	}
    
    	var self = this;
    	if (this._playingBlocked && force) {
    		this.kickPlayingSession(doTheThing);
    	} else {
    		doTheThing();
    	}
    	
    console.log(apps);
    console.log(force);
    
    
    	function doTheThing() {
    		self._send(SteamUser.EMsg.ClientGamesPlayed, apps.map(function(app) {
    			if (typeof app === 'string') {
    				return {
    					"game_id": "15190414816125648896",
    					"game_extra_info": app
    				};
    			}
    
    			if (typeof app === 'object') {
    				return app;
    			}
    
    			return {"game_id": app};
    		}));
    	}
    };
  5. Hello, I don't really know if I'm doing it right.

     

    I have VPS (where I idle steam game hours) and I have 2 the same idle scripts on VPS (different IP) and on local PC.

    Sometimes I need to run idle script on local PC without killing session on VPS, but I getting error: LoggedInElsewhere, and I can't login with local PC, so I decided to try kickPlayingSession.

     

    using this script: click 

     

    bot.setPersona(SteamUser.EPersonaState.Offline);
    bot.kickPlayingSession((callback) => { console.log(callback) });
    bot.gamesPlayed(this.games, true);
    then I getting crash in my app with:

    Error: Cannot kick other session
    but orginal session getting error too: LoggedInElsewhere, but its not crashing

     

    can you please help me what I'm doing wrong here.

  6. Hello, I have a few accounts linked to manager, and I noticed oAuth logins expiring after 1 year after add, and now these accounts which I added 1 year ago, giving me HTTP 401 errors, I need to relog again with steam guard code and it works again.

     

    is there any chance to prevent expiring oAuth logins after 1 year?

×
×
  • Create New...