Jump to content
McKay Development

AbrarK

Member
  • Posts

    7
  • Joined

  • Last visited

AbrarK's Achievements

  1. 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?
  2. 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]); } }
  3. Here's a bit of my code, which works I've removed the callback as it didn't need to be there, so I can check when an offer is pending confirmation, then it gets added to the database, but when it gets added if for some reason the bot doesn't auto acceppt it (I have .checkconfirmations on but still if there's an error) so this code wouldn't be the best, so how would I check upon when the bot confirms a trade? Here's the little bit of code offer.Send(callback etc { 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: 7 }; connection.query('INSERT INTO csgotrades SET ?', tradeData); } });
  4. Here is my current Code http://pastebin.com/0Ezn6rNY So far everything works, however I'm wondering, how do I check if a trade has been acceppted? I want to make it so I can do something like php code: 'socket.emit("getTrade", tradeid)' nodejs code: 'socket.on('getTrade', function(steamid, tradeid) {' GET TRADE STATUS HERE '}' But i also want it so the bot automatically polls and checks the trade status so if the trade gets acceppted/declined the node js bot will do something (I want it so this doesn't require me to send getTrade to the bot and it just automatically checks if the bot acceppts so the bot can update sql records without having to keep clicking 'check trade') so how shall I get the bot to automatically check if a trade has been acceppted after sending? I've had a look at the documentation and I still couldn't seem to get it, so help would be appreciated
×
×
  • Create New...