timgfx Posted April 30, 2016 Report Posted April 30, 2016 (edited) 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 ) 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 April 30, 2016 by timgfx Quote
Dr. McKay Posted April 30, 2016 Report Posted April 30, 2016 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. Quote
timgfx Posted April 30, 2016 Author Report Posted April 30, 2016 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? Quote
timgfx Posted May 1, 2016 Author Report Posted May 1, 2016 Use JSON is my recommendation.And how exactly would I be able to do that? I thought an array of objects would work aswell but I will use JSON anyway. And how am I able to implement it in the bot code? Quote
Dr. McKay Posted May 1, 2016 Report Posted May 1, 2016 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. Quote
timgfx Posted May 1, 2016 Author Report Posted May 1, 2016 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? 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.