AbrarK Posted July 20, 2016 Report Posted July 20, 2016 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);} }); Quote
Dr. McKay Posted July 20, 2016 Report Posted July 20, 2016 You should probably wait for the sentOfferChanged event to be emitted with the offer's state being Active before you add it to your database. 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.