-
Posts
3402 -
Joined
-
Last visited
Everything posted by Dr. McKay
-
Question How to calculate a price
Dr. McKay replied to 72juju's topic in node-steam-tradeoffer-manager
This function should do the trick quite nicely. As with any currency that has decimal places, floating-point imprecision can be an issue so it's best to convert everything to the lowest denomination. function decimalToMetal(dec) { var output = {}; var scrap = Math.round(dec * 9); // Convert it to the lowest denomination (scrap) because floats suck output.refined = Math.floor(scrap / 9); scrap -= output.refined * 9; output.reclaimed = Math.floor(scrap / 3); scrap -= output.reclaimed * 3; output.scrap = scrap; return output; } Returns an object with properties refined, reclaimed, and scrap. -
This is one of those things that has multiple solutions, and even then won't always work. For example, CS:GO by default won't announce game server IPs to Steam friends, so you can't see what map someone is playing in CS:GO if they haven't enabled that client-side option. However, for games that do announce to Steam, this is probably the easiest way: 1. Call GetPlayerSummaries for the user in question to get their game server SteamID (e.g. "gameserversteamid": "90104923353593862",) 2. Call GetServerList to look up the data for that server (e.g. https://api.steampowered.com/IGameServersService/GetServerList/v1/?key=xxx&limit=1&filter=\steamid\90104923353593862) This will give you the data for that server: { "response": { "servers": [ { "addr": "195.154.166.219:27015", "gameport": 27015, "steamid": "90104923353593862", "name": "Meta Construct - how do u carate your charecter", "appid": 4000, "gamedir": "garrysmod", "version": "16.04.30", "product": "garrysmod", "region": 3, "players": 37, "max_players": 123, "bots": 0, "map": "gm_construct_m_222", "secure": false, "dedicated": true, "os": "l", "gametype": " gm:sandbox" } ] } }
-
Question Getting escrow during creation of a trade?
Dr. McKay replied to Techload's topic in node-steam-tradeoffer-manager
It looks like you're using TradeOfferManager v1. That particular method was added in v2. -
1. You're on your own with that. 2. When SteamUser emits webSession, call SteamCommunity#setCookies with the cookies that webSession gave you.
-
Question Getting escrow during creation of a trade?
Dr. McKay replied to Techload's topic in node-steam-tradeoffer-manager
What exactly (please show code) have you tried, and what was the outcome? -
Then you must be doing something wrong. Sorry I can't be more helpful, but error code 2 literally just means "Fail". Maybe try again later?
-
No, that's an object. If you don't know what an array is, please google it.
-
I have no idea what's up with the crafting event, but unless you're emitting it yourself you shouldn't be using it. You don't need to specify any appid or contextid (there is no such thing as a contextid outside of the Steam econ server). node-tf2 knows what TF2's appid is. You need to pass an array of item IDs to craft.
-
Question Setting up limited stock
Dr. McKay replied to TextDynasty's topic in node-steam-tradeoffer-manager
You only need to set up your trading code to not accept overstocked items. -
Question Process exception handle failed
Dr. McKay replied to vaporfan's topic in node-steam-tradeoffer-manager
https://httpstatuses.com/429 -
Why are you editing the library's code? Don't do that.
-
The documentation is pretty clear about how to add an item by assetid: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#addmyitemitem
-
You can't try to send the offer until the callback of webSession. Please read up on asynchronous JavaScript and callbacks.
-
There are some examples in the examples directory that may help: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/tree/master/examples
-
Only get 1 element from Array!
Dr. McKay replied to Insanic12's topic in node-steam-tradeoffer-manager
I don't provide Steam support. I suggest that you take some JavaScript lessons, as I'm only here to help with library integration questions, not with JavaScript basics. You may want to look at Array.prototype.map perhaps. -
That's up to you. Look at the contents of backpack and find what you're looking for.
-
The assetids are available in your backpack.
-
Question LoadUserInventory problem!
Dr. McKay replied to Insanic12's topic in node-steam-tradeoffer-manager
The order of your inventory and err arguments is wrong. Order matters. Also, you might try printing the error if one occurs for more insight. -
Question [EASY] Help me with understanding the variables
Dr. McKay replied to Insanic12's topic in node-steam-tradeoffer-manager
This may help: https://sporto.github.io/blog/2012/12/09/callbacks-listeners-promises/ -
Have you added a phone number to your account?
-
Yes, and no.
-
Yes, that looks correct enough, minus the secrets.
-
-
var client1 = new SteamUser(); var client2 = new SteamUser();