Jump to content
McKay Development

Recommended Posts

Posted

Hi

 

I have little problem with errors (28 actually) (I know - 28 means already redeem). It always shutdown script 

 

Code

  console.log("acceptOffer");
  if(again == 0) return;
  offer.accept(function(error, status) {
    if(error){
      console.log("acceptOffer error");
      console.log(error);
      return;
    }
  });

Console

acceptOffer
acceptOffer error
{ Error: There was an error accepting this trade offer.  Please try again later. (28)
    at Object.exports.makeAnError (/root/app/node_modules/steam-tradeoffer-manager/lib/helpers.js:10:12)
    at SteamCommunity.manager._community.httpRequestPost (/root/app/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:643:13)
    at Request._callback (/root/app/node_modules/steamcommunity/components/http.js:67:15)
    at Request.self.callback (/root/app/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/root/app/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/root/app/node_modules/request/request.js:1001:12) eresult: 28 }
And 
manager.on('receivedOfferChanged', function(offer, oldState) {
console.log("receivedOfferChanged");
});

isn't called

 

 

What I should do?

Cheers

 

Posted

I create new test file with bot. It show same errors and yes - you're right, it doesn't crash app. Is here any way to disable that long error? Thanks (Im sure in 2017 ~March it show only oneline warning like "{ Error: There was an error accepting this trade offer.  Please try again later. (11) }")

 

Test file

 var SteamUser        = require('steam-user');
var SteamTotp         = require('steam-totp');
var TradeOfferManager = require('steam-tradeoffer-manager');
var SteamCommunity    = require('steamcommunity');

var login = "******";
var password = "******";
var shared = "******";
var identity = "******";


var client = new SteamUser();
var community = new SteamCommunity();

  var managerConfig = {
    steam             : client,
    community         : community,
    domain            : "localhost",
    language          : "en",
//  pollInterval      : 3000,
//  cancelTime        : 600000,
//  pendingCancelTime : 30000
  };

client.on('loggedOn', function(){
  console.log("[bot] Logged into steam as " + client.steamID.getSteam3RenderedID());
});

var manager = new TradeOfferManager(managerConfig);
var code = SteamTotp.generateAuthCode(shared);

var logOnOptions = {
  accountName: login,
  password: password,
  twoFactorCode: code,
};

client.logOn(logOnOptions);

client.on('webSession', function(sessionID, cookies){
  manager.setCookies(cookies, function(err){

  });
  community.setCookies(cookies);
  community.startConfirmationChecker(10000, identity);
  community.on('confKeyNeeded', (tag, callback) => {
    const time = Math.floor(Date.now() / 1000)
    console.log("Conf Key Needed" +  JSON.stringify(tag));
    callback(null, time, SteamTotp.generateAuthCode(identity, time, tag))
  });

});

manager.on('newOffer', function(offer) {
    console.log("newOffer"); 
	setTimeout(acceptOffer, 500, offer);
});


function acceptOffer(offer){
  console.log("acceptOffer");
  offer.accept(function(error, status) {
    if(error){
      console.log("acceptOffer error");
      console.log(error);
      return;
    }
  }); 
}

Log

newOffer
acceptOffer
acceptOffer error
{ Error: There was an error accepting this trade offer.  Please try again later. (11)
    at Object.exports.makeAnError (/root/test/node_modules/steam-tradeoffer-manager/lib/helpers.js:10:12)
    at SteamCommunity.manager._community.httpRequestPost (/root/test/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:643:13)
    at Request._callback (/root/test/node_modules/steamcommunity/components/http.js:67:15)
    at Request.self.callback (/root/test/node_modules/steamcommunity/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/root/test/node_modules/steamcommunity/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/root/test/node_modules/steamcommunity/node_modules/request/request.js:1001:12) eresult: 11 }

Cheers

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...