Jump to content
McKay Development

[EASY] Help me with understanding the variables


Recommended Posts

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!

Link to comment
Share on other sites

        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 by Insanic12
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...