Open crazydenix opened 9 years ago
That's pretty low on my priority list. Just listen for the backpackLoaded
event then console.log(tf2.backpack)
to see a raw dump of your backpack contents. That should get you started.
I know this is kind of old, but one way to delete all the crates in your inventory is to add this function to your code and call it anywhere (like when you send a message, "!delete" for example).
function deleteCrates() {
var crates;
steamTrade.loadInventory(440, 2, function(inv) {
crates = inventory.filter(function (item) {
return item.tags.some(function(element, index, array) {
return element.internal_name == 'Supply Crate';
});
});
});
if(crates.length > 0) {
bot.gamesPlayed([440]);
for(var i = 0; i < crates.length; i++) {
tf2.deleteItem([crates[i].id]);
}
}
};
Where bot is an instance of node-steam, steamTrade is an instance of node-steam-trade, and tf2 is an instance of node-tf2 (this module).
It would be better to use node-tf2's cached backpack.
Hello. Can you give example code for delete crates? I'm sorry, but I'm newbe to this issue