Jump to content
McKay Development

Asf

Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Asf

  1. Hello 

     

    Error: Must be logged in before trying to do anything with confirmations

     

    I get this error when executing code in BAS (Browser Automation Studio)

    [[IDENTITY_SECRET]] = JSON.parse([[FILE_CONTENT]]).identity_secret
    var SteamTotp = require('steam-totp');
    [[code2]] = SteamTotp.generateConfirmationKey([[IDENTITY_SECRET]]);
    [[code3]] = SteamTotp.getConfirmationKey([[code2]]);
    [[TIME]] = SteamTotp.time([[timeOffset]]);
    
    var SteamCommunity = require('steamcommunity');
    var community = new SteamCommunity();
    
    var Steam = require('steam-client');
    var client = new Steam.CMClient(Steam.EConnectionProtocol.TCP);
    
    var TradeOfferManager = require('steam-tradeoffer-manager');
    var manager = new TradeOfferManager();
    
    client.on('webSession', (sessionID, cookies) => {
      manager.setCookies(cookies, function (err) {
        if (err) {
          logger.error(err) //игнор.прав
          process.exit(1);
        }
      });
    
      community.setCookies(cookies);
      community.startConfirmationChecker(10000, [[code3]]);
    });
    
            var time = [[TIME]];
            var confKey = [[code3]];
            var allowKey = [[code3]];
            
            community.acceptAllConfirmations(time, confKey, allowKey, function(err, confs){
                 if(err){
                    res.sendError(err);
                  return;
               }
                if(confs == null) confs = [];
                res.sendSuccess(confs);
            });
    
×
×
  • Create New...