Jump to content
McKay Development

Tf2-node Checking if item is tradable and marketable


Recommended Posts

Posted

Hi I'm having some problems to get it to work I currently have 3 quackenbirds(947) one of them which is not tradable and not marketable but when I run this code return is 3.

 

for (var i = 0;i <tf2.backpack.length; i++){
   if (tf2.backpack.defIndex ==  947 && !tf2.backpack.flag_cannot_trade && !tf2.backpack.flag_cannot_craft){
   quack++;
   }
}
Posted

Determining from node-tf2 if an item is tradable is a task. There are like 4 different ways something can be untradable. There could be a flag, there could be one of several attributes, there could be a specific origin (achievement item).

 

You're probably better off just getting your inventory from Community.

  • 9 months later...
Posted

Determining from node-tf2 if an item is tradable is a task. There are like 4 different ways something can be untradable. There could be a flag, there could be one of several attributes, there could be a specific origin (achievement item).

 

You're probably better off just getting your inventory from Community.

 

Do you know how you would go about using each of these? I plan to make a bot that crafts hats with non tradable metal and rebuilding non tradable headgear, so I would prefer to do it with the tf2 backpack. That is unless you already have a easy section of code that takes the item id and checks it against the steam inventory. Otherwise for my project I would rather check the different ways it can be non tradable

Posted

It'll be a lot easier to retrieve your community inventory and just find the item with the matching ID.

Okay so I'm doing that now but I have an issue with the steamcommunity.getUserInventoryContents it seems to be getting skipped in the code and ran at the end so at the time of where it is used it just puts out undefined.

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...