Jump to content
McKay Development

Cubson

Member
  • Posts

    16
  • Joined

  • Last visited

Posts posted by Cubson

  1. const SteamUser = require('steam-user');
    const SteamTotp = require('steam-totp');
    const SteamCommunity = require('steamcommunity');
    const TradeOfferManager = require('steam-tradeoffer-manager');
    
    const client = new SteamUser();
    const community = new SteamCommunity();
    const manager = new TradeOfferManager({
    steam: client,
    community: community,
    language: 'en'
    });
    
    const logOnOptions = {
    accountName: 'hereismylogin',
    password: 'hereismypassword',
    twoFactorCode: SteamTotp.generateAuthCode('hereismysharedsecret')
    };
    
    client.logOn(logOnOptions);
    
    client.on('loggedOn', () => {
    console.log(' > Logged into Steam');
    client.setPersona(SteamUser.Steam.EPersonaState.Online);
    client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]");
    });
    
    client.on('webSession', (sessionid, cookies) => {
        manager.setCookies(cookies, function(err) {
        if (err) return console.log(err);
        console.log(" > Got API key!");
      });
    community.setCookies(cookies);
    community.startConfirmationChecker(6000, 'hereismyidentitysecret');
    });
    
    manager.on('newOffer', (offer) => {
    client.gamesPlayed("Steam Test Bot by Cubson [Busy]");
    if (offer.partner.getSteamID64() === 'firsttrustedguysteamid' || 'secondtrustedguysteamid') {
    offer.accept((err, status) => {
    if (err) {
    console.log(err);
    client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]");
    } else {
    community.checkConfirmations();
    console.log(`Accepted offer. Status: ${status}.`);
    client.gamesPlayed("Steam Test Bot by Cubson [Not Busy]");
    }
    });
    }
    });
    

    What's wrong? And I'm a very big noob in JavaScript and Node.JS and because of it I beg you to explain everything step-by-step.

     

    P.S. Maybe update to IPB 4?

×
×
  • Create New...