0

I am making a steam trade bot and I need to know what items get traded to me so I can store them into a database. The bot is using node-steam and node-steam-tradeoffers. The bot is currently operational and successfully makes trades.

on a succeful trade this is the code that runs:

                    var items = offer.items_to_receive;
                    offers.acceptOffer({tradeOfferId: offer.tradeofferid});
                    logger.info("A Trade has been accepted: " + offer.steamid_other);

                    // prints out all the items received
                    for (i = 0; i < items.length; i++){
                        logger.info("Items recieved: " + items[i]);
                    }

The problem is the output: http://prntscr.com/6jksqw

I have been looking at the steam dev site: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService

I am using the property items_to_receive which is an array of CEcon_Asset. The problem is I don't know how to access the items in the array.

Thanks in advance for your time and help!

BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283
Brian Bishop
  • 33
  • 1
  • 1
  • 5

1 Answers1

1

According to the link your provided, CEcon_Asset have propreties as following :

  • appid
  • contextid
  • assetid - either assetid or currencyid will be set
  • currencyid - either assetid or currencyid will be set
  • classid - together with instanceid, uniquely identifies the display of the item
  • instanceid - together with classid, uniquely identifies the display of the item
  • amount - the amount offered in the trade, for stackable items and currency
  • missing - a boolean that indicates the item is no longer present in the user's inventory

So to access it, from your script, you just have to call the property you're interested in i.e items[i].property or items[i]["property"]
(e.g items[i].instanceid or items[i]["instanceid"])

Kaiido
  • 123,334
  • 13
  • 219
  • 285