Insanic12 Posted October 25, 2016 Report Posted October 25, 2016 Hey so I wanted my bot to check a users inventory. This is how my code looks like. var TradeOfferManager = require("steam-tradeoffer-manager"); var manager = new TradeOfferManager({ "steam": client, "language": "en" }); manager.loadUserInventory(user, "730", "1", "true", ???); console.log(???.inventory); https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOfferManager#loaduserinventorysteamid-appid-contextid-tradableonly-callback So as you see here at the code and the link i provided I haven't defined the callback thing yet indicated with "???". I don't really know what callback means and how I can use it.Please help me understand this variable. Thanks in advance! Quote
Dr. McKay Posted October 25, 2016 Report Posted October 25, 2016 This may help: https://sporto.github.io/blog/2012/12/09/callbacks-listeners-promises/ Quote
Insanic12 Posted October 25, 2016 Author Report Posted October 25, 2016 Thanks alot helped me out! Quote
Insanic12 Posted October 25, 2016 Author Report Posted October 25, 2016 (edited) This may help: https://sporto.github.io/blog/2012/12/09/callbacks-listeners-promises/ manager.loadUserInventory(user, 730, 2, true, function (inventory, err) { if (err) { console.log(warning("[WARNING]: Couldn't load inventory of " + user + "!")); } else { console.log(inventory); } }); Now when i finished the script i get a error. If the script finds a error it will print in console the error message. And it prints error all the time even if i checked the ID of the player i want to check. Edited October 25, 2016 by Insanic12 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.