Jump to content
McKay Development

Recommended Posts

Posted

hello,
im trying to make a steam trade bot (and im not so good with coding).

i found this code to send trade offer but i don"t know how to add items

var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=0000000&token=xxxxxxx");
        manager.loadInventory(730, 2, true, function(err, myItems) {
            if(err) {
                console.error(err);
                return;
            }

            offer.loadPartnerInventory(730, 2, function(err, theirItems) {
                if(err) {
                    console.error(err);
                    return;
                }

                offer.addMyItem(myItems[0]);
                offer.addTheirItem(theirItems[0]);
                offer.send("");


            });
        });
});

let's say i want to :
send 2 items with id 6908727870 and id 6901768067
and
recieve 2 items with id 847548541 and id 325415748

please just help me filling these ids in the code above to serve like an example for me.

thank you so much

 

Posted

Assuming all items are CS:GO items...

var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=123456&token=xxxxxx");

offer.addMyItems([
	{
		"appid": 730,
		"contextid": 2,
		"assetid": "6908727870"
	},
	{
		"appid": 730,
		"contextid": 2,
		"assetid": "6901768067"
	}
]);

offer.addTheirItems([
	{
		"appid": 730,
		"contextid": 2,
		"assetid": "847548541"
	},
	{
		"appid": 730,
		"contextid": 2,
		"assetid": "325415748"
	}
]);

offer.send(function(err, status) {
	if (err) {
		throw err;
	}
	
	console.log("Offer #" + offer.id + " is now " + status);
});
Posted (edited)

Thank you for the help ^^

 

i have two more simple questions :

 

1 - how to make my bot decline any recieved offer ? (because i want the bot to send the offers only).

 

2 - how to check the status of an offer that i already sent ? if it was accepted or declined or changed.

Edited by N4d!r
Posted

You need to check err.

 

solved thank you :)

 

in this code :

offer.addMyItems([
	{
		"appid": 730,
		"contextid": 2,
		"assetid": "6908727870"
	},
	{
		"appid": 730,
		"contextid": 2,
		"assetid": "6901768067"
	}
]);

can i replace it with "addMyItem" like this :

offer.addMyItem({"appid": 730,"contextid": 2,"assetid": "6908727870"});
offer.addMyItem({"appid": 730,"contextid": 2,"assetid": "6908765841"});
offer.addMyItem({"appid": 730,"contextid": 2,"assetid": "6908706992"});

???

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