TextDynasty Posted November 10, 2016 Report Share Posted November 10, 2016 (edited) Hi there. I found a code from gihub and idk if it is working... because it doesnt do anything. user.on('inventory', function (backpack, craft, err) { var inventory = backpackLoaded var random_refined = getRandomRefinedID(inventory); tf2.craftItems([random_refined]); // will smelt first refined found in the inventory setTimeout(function() { steamTrade.loadInventory(440, 2, function(inventory1) { // reload inventory console.log("loaded new inventory 1"); if (JSON.stringify(inventory1) !== JSON.stringify(inventory)) { // if inventory has changed console.log("got the new backpack!"); var random_reclaimed = getReclaimedIDs(inventory1, inventory); //get the id of a reclaimed smelted before tf2.craftItems([random_reclaimed]); // smelt it to a scrap setTimeout(function() { steamTrade.loadInventory(440, 2, function(inventory2) { // reload inventory console.log("loaded new inventory 2"); if (JSON.stringify(inventory2) !== JSON.stringify(inventory1)) { // if inventory has changed console.log("Yes, new backpack!"); inventory = inventory2; } else { console.log("oh no , still the old one"); } }); }, 10000); } else { console.log("still as the old one :("); } }); }, 10000); }) Edited November 10, 2016 by TextDynasty Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted November 10, 2016 Report Share Posted November 10, 2016 What is the inventory event? Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted November 10, 2016 Author Report Share Posted November 10, 2016 What is the inventory event? i want using to code to craft metal, so what should i call it? 'craft'? Quote Link to comment Share on other sites More sharing options...
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.