Jump to content
McKay Development

Bug in new version 1.22.0 (maybe my mistake)


Recommended Posts

When accept TradeOffer, error occurs "Unknown state 2"

Log from my bot:

darkwar1234: Logged On
darkwar1234: new trade offer from 76561198052220848
darkwar1234: Unknown state 2
darkwar1234: cookies are updated!
darkwar1234: trade offer â„–1150955479, status: 3
darkwar1234: trade offer are accepted!

Code:

 offer.accept(function(err){
                if(err){ // here console.log(err.message) "darkwar1234: Unknown state 2"
                    self.relogin(err, function(){
                        self.checkOffer(offer, function(offer){
                            if(offer.state == 3){
                                self.acceptOffer(trade, callback);
                            }else if(offer.state == 2){
                                self.handleOffer(trade, callback);
                            }
                        });
                    });
                    return;
                }
                self.acceptOffer(offer, callback);
            });

And when I use method TradeOffer.update() it receive undefined if I make offer now or if TradeOffer has status 3 it show error Offer no longer valid. I want to use this method instead getOffer in this part of code:

SteamBotManager.prototype.checkOffer = function (offer, callback) {
    var self = this;
    self.manager.getOffer(offer.id, function(err, offer){
        if(err){
            self.relogin(err, function(){
                self.checkOffer(offer, callback);
            });
            return;
        }
        if(offer.state == 2 || offer.state == 3){
            self.log("trade offer â„–"+ offer.id +", status: "+ offer.state);
            if (typeof(callback) === 'function') {
                callback(offer);
            }
        }else{
            self.log("trade offer â„–"+ offer.id +" is no longer valid, status: "+ offer.state +"!");
        }
    });
};

 

Link to comment
Share on other sites

 

Every time when accept

 

For me the same, but not really a problem the trades are still quite quickly accepted on "receivedOfferChanged" event.

But i have related to this another question for other error codes from steam.

accept([autoRetry][, callback])

Which error codes do not accept the trade temporary ? So that the autoRetry function has to accept again (autoRetry after a minute, found in documentation)?

Background is, some trades need a very long time (> 1 minute) to be accepted (usually when steam is under heavy load..)

For me with a bet site its better this trades will be declined when that happens.

So my idea if error code = x message user or try to accept faster again or try to decline...

I found the following error codes 16 and 28, can this be right?

Edited by speedy
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...