Jump to content
McKay Development

[Question] Which object property should I check for when checking what item I am dealing with.


Recommended Posts

I am currently using the market_hash_name since it is always the same for the item (It's the english version of the market_hash). I've heard something about assetid aswell. I am not sure what to use. (By the way sorry for spamming this forum :P)

 

Adding on to that how do I accept trades as long as the itemsToReceive and itemsToGive are correct?

I would like to save the itemToReceive and itemToGive that make the bot accept the trade in a trades.js file and add it to this if statement so that it works:

if (offer.partner.getSteamID64() === '76561198127334975' | offer.itemsToGive.length === 0 /*|| itemsToReceive.market_hash_name and itemsToGive.market_hash_name from the offer equal those from the config*/) {
    offer.accept();
}

So if anybody can help me with that it would be awesome

Edited by timgfx
Link to comment
Share on other sites

market_hash_name is typically the English version of market_name, but not always (e.g. Steam trading cards, backgrounds, and emoticons have their market_hash_names prefixed with the appid of the owning app). Also note that unmarketable items aren't guaranteed to have a market_hash_name or market_name (they always will for Valve games, at the present moment). Outside of those exceptions, market_hash_name is a good candidate for identifying an item.

 

The item's assetid is just how you refer to the item when you're trading and such. It's unique for every single item in the game, and it changes when you trade it.

Link to comment
Share on other sites

market_hash_name is typically the English version of market_name, but not always (e.g. Steam trading cards, backgrounds, and emoticons have their market_hash_names prefixed with the appid of the owning app). Also note that unmarketable items aren't guaranteed to have a market_hash_name or market_name (they always will for Valve games, at the present moment). Outside of those exceptions, market_hash_name is a good candidate for identifying an item.

 

The item's assetid is just how you refer to the item when you're trading and such. It's unique for every single item in the game, and it changes when you trade it.

Okay, so only accepting a trade if ... item is included is not possible with the assetid. Since I am only trading CS:GO items (always marketable) I think I will use market_hash_name. Do you have any suggestions to save trades my bot has to accept in another file?

Link to comment
Share on other sites

You can parse a JSON file in Node using just require('./file.json')

 

It's up to you what you put in it and how you handle it.

The parsing isn't really the problem then, just how to check it. I've tried an if statement checking if the offer itemsToGet and itemsToReceive market_hash_name's matched the ones on the file but it didn't work for some reason. Can you give me an example on how to check if the trades itemsToGet and itemsToReceive and those of the JSON file are the same?

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