Techload Posted October 29, 2016 Report Posted October 29, 2016 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. Quote
Dr. McKay Posted October 29, 2016 Report Posted October 29, 2016 What exactly (please show code) have you tried, and what was the outcome? Quote
Techload Posted October 30, 2016 Author Report Posted October 30, 2016 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. Quote
Dr. McKay Posted October 30, 2016 Report Posted October 30, 2016 It looks like you're using TradeOfferManager v1. That particular method was added in v2. Quote
Techload Posted October 31, 2016 Author Report Posted October 31, 2016 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) Quote
Techload Posted October 31, 2016 Author Report Posted October 31, 2016 I updated the whole send trade function, and now it's working.Thank you very much for your assistance. Quote
Dr. McKay Posted October 31, 2016 Report Posted October 31, 2016 I'm glad you got it working. If you haven't already, I suggest that you check all the breaking changes in v2 to make sure nothing else needs to be changed on your end. 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.