AbrarK Posted July 22, 2016 Report Posted July 22, 2016 http://pastebin.com/sDi8gSc0 This is my code right now, when I send trades with only my items/my items added it says An error occured whilst sending trade offer: Error: HTTP error 401 but when I send a trade offer where I don't add any of my items (only their items) it works fine, so may I ask how do I stop this error? Here's my code for sending a trade with my items if(type == "withdraw") { offer.setMessage("By acceppting this offer you will lose " + value + " Gems"); for (var a = 0; a < itemsToGive.length; a++) { offer.addMyItem({"assetid": itemsToGive[a], "appid": 730, "contextid":2}); console.log(itemsToGive[a]); } } offer.send(function(err, status) { if (err) { console.log("An error occured whilst sending trade offer: " + err); } if(status == "pending") { console.log("Trade offer Pending. Offer #" + offer.id + " Regardless, adding to database with the offer state: 9"); tradeData = { tradeofferid: offer.id, steamid: partner, type: type, amount: value, paid: 0, offerState: 9 }; connection.query('INSERT INTO csgotrades SET ?', tradeData); } if (status == "sent") { console.log("Trade offer succesfully sent. Offer #" + offer.id); tradeData = { tradeofferid: offer.id, steamid: partner, type: type, amount: value, paid: 0, offerState: offer.state }; connection.query('INSERT INTO csgotrades SET ?', tradeData); } }); I can send trades with their items fine but with mine I just get the error if(type == "withdraw") { offer.setMessage("By acceppting this offer you will lose " + value + " Gems"); for (var a = 0; a < itemsToGive.length; a++) { offer.addMyItem({"assetid": itemsToGive[a], "appid": 730, "contextid":2}); console.log(itemsToGive[a]); } } Quote
Dr. McKay Posted July 22, 2016 Report Posted July 22, 2016 401 usually means you aren't logged in. Quote
AbrarK Posted July 24, 2016 Author Report Posted July 24, 2016 401 usually means you aren't logged in.The bot has logged in, as it notifies in the console when the bot logs in also the bot can send trade offers where the bot's items aren't needed so I believe it is logged in? 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.