HeilShuckle Posted August 22, 2017 Report Posted August 22, 2017 I'm trying to figure out how to get the contents of the inventory of my own bot. I use const SteamUser = require('steam-user');const client = new SteamUser(); but I haven't been able to find a way to load the inventory with something like client.getInventoryContents(); I'm sure there's a way to do it, but i'm flat lining in my head right now. Quote
Dr. McKay Posted August 22, 2017 Report Posted August 22, 2017 You can't do it with node-steam-user. You'll want node-steamcommunity to do that. Quote
HeilShuckle Posted August 22, 2017 Author Report Posted August 22, 2017 Well then how would I use node-steamcommunity to get the inventory of my client? Quote
Dr. McKay Posted August 22, 2017 Report Posted August 22, 2017 Please read the documentation. It's fairly straightforward. Quote
HeilShuckle Posted August 22, 2017 Author Report Posted August 22, 2017 I'm sorry, I've looked through it and tried a bunch of stuff, but I can't figure it out because the commands in steamcommunity are asking for a type of object that the client isn't. I may be entirely wrong here, but all I need is for you to show me an example, Im just so confused. Quote
Dr. McKay Posted August 22, 2017 Report Posted August 22, 2017 community = new SteamCommunity(); community.login({"accountName": "username", "password": "password", "twoFactorCode": "ABCDE"}, (err, sessionID, cookies, steamguard, oAuthToken) => { if (err) { throw err; } community.getUserInventoryContents("[U:1:46143802]", 730, 2, true, (err, inventory) => { if (err) { throw err; } console.log(inventory); }); }); Quote
xLeeJYx Posted August 23, 2017 Report Posted August 23, 2017 community = new SteamCommunity(); community.login({"accountName": "username", "password": "password", "twoFactorCode": "ABCDE"}, (err, sessionID, cookies, steamguard, oAuthToken) => { if (err) { throw err; } community.getUserInventoryContents("[U:1:46143802]", 730, 2, true, (err, inventory) => { if (err) { throw err; } console.log(inventory); }); });https://github.com/DoctorMcKay/node-steamcommunity/wiki/CSteamUser#getinventorycontentsappid-contextid-tradableonly-language-callbackdidn't say we have to put steam id :V and i cant get it working until i saw this code Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.