Fastmancz Posted September 8, 2017 Report Posted September 8, 2017 Hello, can you tell me, how to make conditions for: You have logged in from a new device. In order to protect the items in your inventory, you will be unable to trade from this device for 7 days. Is it possible to make a condition that immediately rejects a bid on any mistake by Steam? I tried to list (offer.state) in (console.log) and always I get = 2 (to this error message - You have logged....). function processOffer(offer) { if (offer.isGlitched() || offer.state === 11) { //console.log("Offer was glitched, declining."); declineOffer(offer); } else if (offer.partner.getSteamID64() === config.ownerID) { acceptOffer(offer); var item = ourItems[i].market_name; } else { //my_code } function acceptOffer(offer) { offer.accept((err) => { community.checkConfirmations(); //console.log("We Accepted an offer"); if (err); //console.log("There was an error accepting the offer."); }); } function declineOffer(offer) { offer.decline((err) => { //console.log("We Declined an offer"); if (err); //console.log("There was an error declining the offer."); }); } Thanks for help and answer. Quote
Andrei Elvis Posted September 27, 2017 Report Posted September 27, 2017 That processOffer should be like this: function processOffer(offer, oldstate) { if (offer.isGlitched() || (offer.state === 11 && oldstate == 2)) { //console.log("Offer was glitched, declining."); declineOffer(offer); } else if (offer.partner.getSteamID64() === config.ownerID) { acceptOffer(offer); var item = ourItems[i].market_name; } else { //my_code } And at the event 'sentOfferChanged' you should put the function: processOffer(offer, oldstate);Note: On the event 'sentOfferChanged' put the oldstate to be same as on the processOffer function. 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.