Jump to content
McKay Development

Auto smelt and craft metal?


TextDynasty

Recommended Posts

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
Link to comment
Share on other sites

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);
};
Link to comment
Share on other sites

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")
});
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...