Jump to content
McKay Development

Silentz0r

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Silentz0r

  1. I know this isn't javascript support but just out of courisity u changed this:

    self.getPersonas(friends, function() {
     +			process.nextTick(function() {
     +				self.emit('friendPersonasLoaded');
     +			});
     +		});
    

    what process.nexttick does in this function? If i have to guess, calls another function at the end of the getPersonas and outputs FriendPersonasLoaded, correct?

  2. Hi, quick question.

     

    i'm trying to display my current online friends with persona_state >= 1 in the console for debugging at the moment to do some stuffs with it. If i check for them in:

    client.on('user', function(steamID, user) {
        console.log(_.size(client.users));
    });
    

    with this code i get the size of the array that is my number of "friends" i can filter only online friends with persona_state cool. But the thing is i get in the console repeated messages displaying the users count. I understand this event is updated when something changes according to the documentation.

     

     

     

    user
    • sid - A SteamID object for the user whose data we just received
    • user - An object containing the user's persona data

    v1.9.0 or later is required to use this event

    This is an ID event.

    Emitted when Steam sends us persona information about a user. The users property isn't yet updated when this is emitted, so you can compare to see what changed.

     

    That's why my code is emitting this value as this gets updated and doing something like this:

     

     

    1

    2

    3

    ....

    n

     

    My question is, how can i check this when my bot fully updated the friends states not duplicating the message? i did it outside the event and my bot yells "0" when is launching. i'm fairly new at coding and picked this as a project for fun. 

     

    Thank you. Sorry for my english, not my native language. 

×
×
  • Create New...