Jump to content
McKay Development

Recommended Posts

Posted

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

Screenshot 2022-04-20 004859.png

Screenshot 2022-04-20 004636.png

Posted (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 by newbboy9969
item=>items
Posted

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.

Posted (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 by newbboy9969
one* be*
  • 6 months later...
Posted
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"
            ]
        ]
    }
]

 

Posted (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 by SENPAY98K
Success

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