TextDynasty Posted December 31, 2017 Report Posted December 31, 2017 I have a question about where should i put my crafting recipe in the code My code //Show Online client.on('loggedOn', function (details) { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); client.setPersona(1); }); //crafting tf2.on("backpackLoaded", function(craft) { manager.getInventoryContents(440, 2, true, function (err, inventory){ if (err) { console.log(err); } else { var scrap = inventory.filter(function (item) { return item.name == "Scrap Metal" }); var reclaimed = inventory.filter(function (item) { return item.name == "Reclaimed Metal" }); var refined = inventory.filter(function (item) { return item.name == "Refined Metal" }); if (refined.length < 1){ console.log("NO REF"); for (let i = 0; i < reclaimed.length; i++) { tf2.craft([reclaimed[i].id]); //where should i put my recipe in? } } } }); }) https://dev.doctormckay.com/topic/1416-tf2-crafting-recipe/?hl=recipe I tried this code, yes it crafted me some metals, but i want refined metal while it gave me scrap from reclaimed metals. So how can i change my recipe in order to get what i needed? Btw Happy New Year McKay Quote
Dr. McKay Posted December 31, 2017 Report Posted December 31, 2017 You need to pass craft an array of item IDs you want to craft together. Right now you're just passing in one metal per craft, so it's smelting the metal down because that's all it can do with one metal. Quote
TextDynasty Posted January 1, 2018 Author Report Posted January 1, 2018 (edited) You need to pass craft an array of item IDs you want to craft together. Right now you're just passing in one metal per craft, so it's smelting the metal down because that's all it can do with one metal.How can i put them together? console.log("NO REF"); for (let i = 0; i < scrap.length; i++) { var array = [scrap.id, scrap.id, scrap.id] tf2.craft(array); } Edited January 1, 2018 by TextDynasty Quote
TextDynasty Posted January 5, 2018 Author Report Posted January 5, 2018 //Error Friend message from admin: !ref 3 USER WANT REF { Error: The request is a duplicate and the action has already occurred in the past, ignored this time Quote
xLeeJYx Posted January 6, 2018 Report Posted January 6, 2018 I have a question about where should i put my crafting recipe in the code My code //Show Online client.on('loggedOn', function (details) { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); client.setPersona(1); }); //crafting tf2.on("backpackLoaded", function(craft) { manager.getInventoryContents(440, 2, true, function (err, inventory){ if (err) { console.log(err); } else { var scrap = inventory.filter(function (item) { return item.name == "Scrap Metal" }); var reclaimed = inventory.filter(function (item) { return item.name == "Reclaimed Metal" }); var refined = inventory.filter(function (item) { return item.name == "Refined Metal" }); if (refined.length < 1){ console.log("NO REF"); for (let i = 0; i < reclaimed.length; i++) { tf2.craft([reclaimed[i].id]); //where should i put my recipe in? } } } }); }) https://dev.doctormckay.com/topic/1416-tf2-crafting-recipe/?hl=recipe I tried this code, yes it crafted me some metals, but i want refined metal while it gave me scrap from reclaimed metals. So how can i change my recipe in order to get what i needed? Btw Happy New Year McKayhttps://github.com/xLeeJYx/TF2-Crafting-Recipe/blob/master/craftRecipe.json Follow that, and btw you have to craft scrap to reclaimed, then reclaimed to refined. You cant go x9 scrap immediately to refined Quote
TextDynasty Posted January 6, 2018 Author Report Posted January 6, 2018 https://github.com/xLeeJYx/TF2-Crafting-Recipe/blob/master/craftRecipe.json Follow that, and btw you have to craft scrap to reclaimed, then reclaimed to refined. You cant go x9 scrap immediately to refinedThanks for the recipe, but i still cannot figure out how to put them all together like McKay said. Quote
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.