Go Fast Posted March 5, 2018 Report Share Posted March 5, 2018 (edited) Hi, I have 2 things I'm not quite sure about: 1) Currently I use getUserInventoryContents(appid,contextid...etc) to load user's inventory as well as mine. Is it possible to select items from 2 different games in the same trade offer? For example: Their items in trade window will have both CSGO + Steam inventory items 2) How do I go about adding a certain amount of Steam Gems from user's / bot's inventory? I read this article: https://dev.doctormckay.com/topic/332-identifying-steam-items/ and know what asseid,contextid stands for, but I just can't figure out how to find a specific item in an inventory and select Steam gems for example Any help is appreciated! Edited March 5, 2018 by Go Fast Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted March 5, 2018 Report Share Posted March 5, 2018 Sure, just load two inventories and add two items from different games. Change the amount property on the item. For example: manager.getUserInventoryContents(steamID, 753, 6, true, (err, inv) => { if (err) { throw err; } let gems = inv.filter(item => item.market_hash_name == "Gems"); let item = gems[0]; item.amount = 300; offer.addMyItem(item); }); Go Fast 1 Quote Link to comment Share on other sites More sharing options...
Go Fast Posted March 5, 2018 Author Report Share Posted March 5, 2018 (edited) Sure, just load two inventories and add two items from different games. Change the amount property on the item. For example: manager.getUserInventoryContents(steamID, 753, 6, true, (err, inv) => { if (err) { throw err; } let gems = inv.filter(item => item.market_hash_name == "Gems"); let item = gems[0]; item.amount = 300; offer.addMyItem(item); }); That was extremely helpful! Thanks!I wasn't aware of the built in inv.filter command, so I made my own. At least now I know of a more efficient way Edited March 5, 2018 by Dr. McKay Fixed quote Quote Link to comment Share on other sites More sharing options...
Go Fast Posted March 6, 2018 Author Report Share Posted March 6, 2018 (edited) Sure, just load two inventories and add two items from different games. Change the amount property on the item. For example: manager.getUserInventoryContents(steamID, 753, 6, true, (err, theirInv) => { if (err) { throw err; } let gems = inv.filter(item => item.market_hash_name == "Gems"); let item = gems[0]; item.amount = 300; offer.addMyItem(item); }); Just realized filter() is a javascript method. I solved it Edited March 6, 2018 by Go Fast Quote Link to comment Share on other sites More sharing options...
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.