TextDynasty Posted October 16, 2016 Report Share Posted October 16, 2016 How to auto smelt and craft metals? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 16, 2016 Report Share Posted October 16, 2016 You can use node-tf2 to get and craft your inventory. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 16, 2016 Author Report Share Posted October 16, 2016 (edited) You can use node-tf2 to get and craft your inventory.Sorry i don't know how to use it.i have tried this client.on('craft', function (craft) { craft(5002) }) Any examples? Thanks. And also how to make a list of my backpack? Edited October 16, 2016 by TextDynasty 72juju 1 Quote Link to comment Share on other sites More sharing options...
72juju Posted October 16, 2016 Report Share Posted October 16, 2016 Me too i want example please Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 16, 2016 Report Share Posted October 16, 2016 https://github.com/DoctorMcKay/node-tf2#backpack Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 24, 2016 Author Report Share Posted October 24, 2016 (edited) https://github.com/DoctorMcKay/node-tf2#backpackWhat means by "recipe"? var tf2 = new TeamFortress2(user); var user = new SteamUser(); tf2.on('crafting', function (craft) { if (item.name == "Refined Metal") { return Refined++ } if (Refined > 10) { tf2.craft("5002"); console.log("Smelted Some Refined Metals"); }}); Did i do anythings wrong here? It didn't seems working Edited October 24, 2016 by TextDynasty Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 24, 2016 Report Share Posted October 24, 2016 The recipe parameter is optional and you don't normally need to specify it. items should be an array of item IDs to craft. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 24, 2016 Author Report Share Posted October 24, 2016 The recipe parameter is optional and you don't normally need to specify it. items should be an array of item IDs to craft. So.. we need to have the assetid every time? Is there a way to lock the item id? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 24, 2016 Report Share Posted October 24, 2016 Yes, and no. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 25, 2016 Author Report Share Posted October 25, 2016 Yes, and no.so there is no way to automatic smelt metals? Since the assetid changes every times... Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 25, 2016 Report Share Posted October 25, 2016 The assetids are available in your backpack. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 25, 2016 Author Report Share Posted October 25, 2016 The assetids are available in your backpack.But it means I need to change the code every time when smelter or crafted a metal? Is there a way to get the assetid automatically without having to change the code every time? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 25, 2016 Report Share Posted October 25, 2016 That's up to you. Look at the contents of backpack and find what you're looking for. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 26, 2016 Author Report Share Posted October 26, 2016 That's up to you. Look at the contents of backpack and find what you're looking for. I've seen you example but i still don't understand what to do with the recipe because it doesn't do anything to my metal handlers[Language.CraftResponse] = function(body) { var blueprint = body.readInt16(); // recipe ID?? var unknown = body.readUint32(); var idCount = body.readUint16(); var idList = [440, 2, 5193739645]; // 5193739645 is my assetid for(var i = 0; i < idCount; i++) { var id = body.readUint64().toString(); idList.push(id); // item id } this.emit('craftingComplete', blueprint, idList); }; Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 26, 2016 Report Share Posted October 26, 2016 Why are you editing the library's code? Don't do that. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 27, 2016 Author Report Share Posted October 27, 2016 Why are you editing the library's code? Don't do that.sorry, I thought it was an example... but i don't really understand about the backpack.... sorry about i may be annoying... I have tried my best client.on('crafting', function(err, craftItems) { craftItems(440, 2, 5193739645) //can we skip the recipe part and get assetid from backpack directly replace the code? console.log("Crafted Metals") }); Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 27, 2016 Report Share Posted October 27, 2016 I have no idea what's up with the crafting event, but unless you're emitting it yourself you shouldn't be using it. You don't need to specify any appid or contextid (there is no such thing as a contextid outside of the Steam econ server). node-tf2 knows what TF2's appid is. You need to pass an array of item IDs to craft. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted October 27, 2016 Author Report Share Posted October 27, 2016 I have no idea what's up with the crafting event, but unless you're emitting it yourself you shouldn't be using it. You don't need to specify any appid or contextid (there is no such thing as a contextid outside of the Steam econ server). node-tf2 knows what TF2's appid is. You need to pass an array of item IDs to craft.Array is like this? { "appid": 440, "contextid": 2, "amount": 1, "assetid": "1627590398" } But i tried that, he said i "appid" is need to follow by ")". i don't know what to do Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted October 27, 2016 Report Share Posted October 27, 2016 No, that's an object. If you don't know what an array is, please google it. 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.