Jump to content
McKay Development

Recommended Posts

Posted (edited)

What 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 by TextDynasty
Posted

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?

Posted

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);
};
Posted

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")
});
Posted

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.

Posted

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...