Jump to content
McKay Development

Jyn

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Jyn

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


  2. For whatever reason I cant seem to get any values from defIndex. From the first log each item in my backpack is just being returned as having a defIndex of undefined.
    what is annoying too is that tf2.backpack[i].id works fine to get the specific item id's. Code below:



    tf2.on('backpackLoaded', function () {
    log("Loaded our backpack.");
    lookforrefined()
    });

    function lookforrefined() {
    var refcount = 0;
    for (i = 0; i <tf2.backpack.length; i++) {
    log(tf2.backpack[i].defIndex); // only returning 'undefined'

    if (tf2.backpack[i].defIndex === 5002) {
    refcount++;
    log("foundref");
    }
    }
    log(refcount)
    };

     

×
×
  • Create New...