Silentz0r
Member-
Posts
3 -
Joined
-
Last visited
Everything posted by Silentz0r
-
Question Client.users after the bot fully connected?
Silentz0r replied to Silentz0r's topic in node-steam-user
Oh i see, thank you Doc! -
Question Client.users after the bot fully connected?
Silentz0r replied to Silentz0r's topic in node-steam-user
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? -
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. That's why my code is emitting this value as this gets updated and doing something like this: 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.