-
Posts
3544 -
Joined
-
Last visited
Everything posted by Dr. McKay
-
Like, actually online? You used setPersona to mark it as online?
-
Show all your code please. And indent it properly so it's readable.
-
Is your bot online?
-
What's invalid about that response?
-
Get the trading partner of a active trade offer.
Dr. McKay replied to 72juju's topic in node-steam-tradeoffer-manager
sent is an array of TradeOffers. -
Question Bot running 24/7 - Quick question
Dr. McKay replied to Frost Byte's topic in node-steam-user
You can use webLogOn at any time, but if you spam Steam then Valve is not likely to be happy. You shouldn't create an interval inside of an event callback. Create it outside the callback, in the root level of the module (the part that has no indentation). Keep track of the last time you called webLogOn (a timestamp) and don't call it if it was less than say a minute ago. -
Question Bot running 24/7 - Quick question
Dr. McKay replied to Frost Byte's topic in node-steam-user
Use setInterval but outside of any event callback. Also, you need to keep track of the last time you called webLogOn and abandon if it was too soon ago, as sessionExpired can be emitted at any frequency (perhaps several times a second). -
Question Bot running 24/7 - Quick question
Dr. McKay replied to Frost Byte's topic in node-steam-user
You will always get an err in sessionExpired. It's not indicating that there was an error in the session expiring or anything, it's just the Error that made us aware that the session has expired. Also, I'd suggest keeping the login interval as well. -
Send Offer - callback is not a function
Dr. McKay replied to jensej's topic in node-steam-tradeoffer-manager
What version are you using? -
Question Bot running 24/7 - Quick question
Dr. McKay replied to Frost Byte's topic in node-steam-user
You're correct regarding the behavior of setTimeout and setInterval. The problem is, if you create a new interval every time you get a new web session, then you end up with many auto-repeating timers. -
Question Bot running 24/7 - Quick question
Dr. McKay replied to Frost Byte's topic in node-steam-user
That will create a new interval every time your session expires. Either use setTimeout or create the internal outside of that event callback. Also, you may want to listen for the sessionExpired event. -
What is the inventory event?
-
If that works it's a fluke. You should pass an Error to the callback, like this: callback(new Error("File not found"));
-
Your first code snippet will work if you get rid of the parenthesis. Like this: setTimeout(getGuardCode, 30000); You need to pass setTimeout a function. By adding parenthesis, you're calling the function and passing its return value (undefined) instead of passing it.
-
Yes, you should set a timeout. The code a couple posts back will just spam Steam with login requests which will get you locked out. That's not how you set a timeout, though. You want this: setTimeout(function() { callback(SteamTotp.generateAuthCode(config.sharedsecret)); }, 30000);
-
https://github.com/DoctorMcKay/node-steam-user#friendorchatmessage
-
Question How to edit a Discussion on Steam Game page
Dr. McKay replied to Rzeszow's topic in node-steamcommunity
Maybe someday, but I don't have any immediate plans at the moment. -
No. No Steam services support IPv6 at the present time.
-
Okay, well getSteamID64 didn't work because it appears that you're using node-steam's friends handler alongside SteamUser, which is unnecessary. All functionality from node-steam is available in SteamUser directly. The getPersonas method requests data from Steam and calls your provided callback with the personas object once the data is received. You're correct, the properties of personas are objects. In this case, since you requested data for only one user, there is only one property. In cases where you request data for multiple users, there will be more properties defined. Each sub-object contains the data we received from Steam, which is where player_name comes from. The ? and : are the ternary operator, which is more or less an "inline if" statement. In this case, it's checking whether the persona data exists in order to determine whether to pull the player_name from the data or to fallback to a default value. In this case, it was unnecessary, I just didn't feel like checking whether it was possible for getPersonas to not return data for the requested user(s) (it's not).
-
Question How to edit a Discussion on Steam Game page
Dr. McKay replied to Rzeszow's topic in node-steamcommunity
There is presently no functionality available to do that. -
There is no way to enumerate classids.
-
Your problem is that getPersonas expects an array as the first argument, and you aren't passing it an array. What you want to do is client.getPersonas([steamID], function(personas) { /* etc */ }); Also in this case, the callback is essentially mandatory for you. getPersonas doesn't return anything. The data is only available inside the callback. In your case, you want something like this: client.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); // the player's name is now available as name });