newbboy9969 Posted April 19, 2022 Report Posted April 19, 2022 below is my code when i try to addtheiritem it just freezes and doesnt do anything if i have a console.log() above it it just spams it i have checked to make sure the tradelink is correct and so is the item id i even added a getpartnerinvetory() just incase there was a problem with that, i dont really understand what im doing wrong every yt video ive watched does it like this and even the docs do. the account details are correct it just doesnt seem to add the items ive tried taking out the addtheiritem and sending the trade without anything i get a empty trade error that should mean the trades definitely started right? any help is appreciated Quote
Dr. McKay Posted April 20, 2022 Report Posted April 20, 2022 addTheirItem does not take a number argument. Re-read the docs. Quote
newbboy9969 Posted April 20, 2022 Author Report Posted April 20, 2022 (edited) 12 hours ago, Dr. McKay said: addTheirItem does not take a number argument. Re-read the docs. is it possible to take a list of assetids and add them into addTheirItems or does it have to be from the getpartnerinventory list ? Edited April 20, 2022 by newbboy9969 item=>items Quote
Dr. McKay Posted April 20, 2022 Report Posted April 20, 2022 You could manually construct an object, like this: let assetIds = [1, 2, 3, 4, 5]; offer.addTheirItems(assetIds.map(id => ({appid: 730, contextid: 2, assetid: id}))); Steam needs to know which game you want to access items for, so the appid and contextid are required. Quote
newbboy9969 Posted April 20, 2022 Author Report Posted April 20, 2022 (edited) 1 hour ago, Dr. McKay said: You could manually construct an object, like this: let assetIds = [1, 2, 3, 4, 5]; offer.addTheirItems(assetIds.map(id => ({appid: 730, contextid: 2, assetid: id}))); Steam needs to know which game you want to access items for, so the appid and contextid are required. is it possible to load more than 1 inventory for ex: load 1 inventory with the appid 730 and one with the app id 720 . do they have to seperatly loaded or can i throw an array in there and have it work? Edited April 20, 2022 by newbboy9969 one* be* Quote
Dr. McKay Posted April 21, 2022 Report Posted April 21, 2022 You have to load inventories separately, but you can mix and match items added to a trade from different games. Quote
SENPAY98K Posted November 4, 2022 Report Posted November 4, 2022 On 4/20/2022 at 8:57 PM, Dr. McKay said: You could manually construct an object, like this: let assetIds = [1, 2, 3, 4, 5]; offer.addTheirItems(assetIds.map(id => ({appid: 730, contextid: 2, assetid: id}))); Steam needs to know which game you want to access items for, so the appid and contextid are required. the map only stocks ids [ { "appid": 753, "contextid": 6, "assetid": [ [ "22434481908", "22434481910", "22434481915", "22434481907", "22434481917" ], [ "22434481909", "22434481911", "22434481918", "22434481913", "22434481919" ], [ "22434481914", "22434481912", "22434481921", "22434481916", "22434481920" ] ] } ] Quote
Dr. McKay Posted November 4, 2022 Report Posted November 4, 2022 Looks like your assetIds variable contains an array of arrays. SENPAY98K 1 Quote
SENPAY98K Posted November 4, 2022 Report Posted November 4, 2022 (edited) 59 minutes ago, Dr. McKay said: Looks like your assetIds variable contains an array of arrays. Thanks for the notice, its done successfully now :) Edited November 4, 2022 by SENPAY98K Success 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.