Jump to content
McKay Development

Getting escrow during creation of a trade?


Recommended Posts

So, I'm currently working on developing a trading bot for my website, instead of letting someone else do it, as there's only one way to gain experience.

 

So far I have managed to do somewhat of a decent job, it works. But I have come to a point where I would need to do so it does not trade with users that are in escrow.

This should preferably be checked during the process of making the offer.

 

I have read, and tried what have been given in this thread - https://dev.doctormckay.com/topic/623-decline-trade-hold/ - but have reached the point of where I'm unsure of what to do, and seeking help from someone who have more knowledge than me with this.

 

So I hope there's someone who's able to help, or point me in the right direction.

 

Thanks in advance.

Link to comment
Share on other sites

The code that I'm using is as follows:

function makeTrade(){

	//Creating the offer, and adding the items.
	var offer = manager.createOffer(userSteamID); //Creating a offer to their steamid

	//Adding their items. turn this into addTheirItems later instead.
	var theirItems = (row[0].userassetid).split(',');
	for (i = 0; i < theirItems.length; i++) {
		console.log('Adding: ' + theirItems[i]);
		offer.addTheirItem({"appid": 730, "contextid": 2, "assetid": theirItems[i]});
	}

	//Adding our itemsm, turn this into addMyItems later instead.
	var ourItems = (row[0].botassetid).split(',');
	for (i = 0; i < ourItems.length; i++) {
		console.log('Adding: ' + ourItems[i]);
		offer.addMyItem({"appid": 730, "contextid": 2, "assetid": ourItems[i]});
	}

	offer.send("Just attempting to do an offer.", userToken, function(err, status) {
		if (err) {
			console.log(err);
		} else {
			console.log('Tradeoffer sent');
		}
	});
	});
}

What I did try, was adding it after the var offer had been made, I did also attempt to add it during a trade processing, but both instances turned up with it being a invalid function.

Link to comment
Share on other sites

Thanks for the response, I tried uninstalling the current version that I was using, and installed a new one, however, now I'm getting a callback error, stating it's not a function.

To be precise, the whole error is as follows:

callback(error);
                        ^
TypeError: callback is not a function
    at Object.exports.makeAnError (mygreatpc\node_modules\steam-tradeoffer-manager\lib\helpers.js:29:4)
    at SteamCommunity.<anonymous> (mygreatpc\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:490:12)
    at Request._callback (mygreatpc\node_modules\steam-tradeoffer-manager\node_modules\steamcommunity\components\http.js:67:15)
    at Request.self.callback (mygreatpc\node_modules\request\request.js:198:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (mygreatpc\node_modules\request\request.js:1035:10)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (mygreatpc\node_modules\request\request.js:962:12)
Link to comment
Share on other sites

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