Jump to content


Photo

Cannot get confirmations list


  • Please log in to reply
5 replies to this topic

#1 faza

faza

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 03 February 2019 - 06:10 PM

I have code like this:

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const config = require('./steam-config2');
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 logInOptions = {
	accountName: config.accountName,
	password: config.password,
	twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret)
};

client.logOn(logInOptions);

client.on('loggedOn', () => {
    console.log('Steam bot logged on');

	client.setPersona(SteamUser.Steam.EPersonaState.Online);
	client.gamesPlayed('steam trade bot');

	});



client.on('webSession', (sid, cookies) => {
	console.log('webSession');
	manager.setCookies(cookies);
	community.setCookies(cookies);
	community.startConfirmationChecker(10000, config.identitySecret);
	sendFloralShirt();
});


 community.on('debug', console.log);

function sendFloralShirt() {
    manager.loadInventory(730, 2, true, (err, inventory) => {
        if (err) {
            console.log(err);
        } else {
            const offer = manager.createOffer('76561198084368000');
    	inventory.forEach(function (item) {
        if (item.assetid === '15243530000') {
            offer.addMyItem(item);
            offer.setMessage('You received a trade offer motherfucker!');
            offer.send((err, status) => {
                if (err) {
                    console.log(err);
                } else {
                    console.log('trade sent');
				console.log(status);
				
			});



        }
    })
}
})
};

manager.on('newOffer', function () {
	console.log('offer detected');
});

In console Ive got this:

$ node index.js
Steam bot logged on
webSession
Checking confirmations
Can't check confirmations: It looks like your Steam Guard Mobile Authenticator i
s providing incorrect Steam Guard codes. This could be caused by an inaccurate c
lock or bad timezone settings on your device. If your time settings are correct,
 it could be that a different device has been set up to provide the Steam Guard
codes for your account, which means the authenticator on this device is no longe
r valid.

Al other functions works correctly: login, create outcoming trade offer, accept incoming trade offer. But I cant get confirmations list, also I cant accept offer by acceptConfirmationForObject. I cant understand whats wrong here.

Package versions is:

"steam-totp": "^2.1.0",
"steam-tradeoffer-manager": "^2.9.4",
"steam-user": "^3.29.3",
"steamcommunity": "^3.38.0"


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,127 posts

Posted 04 February 2019 - 08:22 PM

  1. Do not use the confirmation checker
  2. Your time is wrong or your secret is wrong


#3 faza

faza

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 06 February 2019 - 05:55 AM

1. Also I tried to use community.acceptConfirmationForObject on offer.send callback, but get the same resuit.
2. I use DigitalOcean vps. I think it cant get problems with time.

Edited by faza, 06 February 2019 - 06:02 AM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,127 posts

Posted 06 February 2019 - 07:09 PM

If your clock is wrong and you can't fix it, you'll need to use getTimeOffset and account for it.



#5 faza

faza

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 07 February 2019 - 04:49 AM

I run this code:

SteamTotp.getTimeOffset(function (err, offset, latecy) {
        if (err){
            console.log(err);
        }  else{
            console.log('offset='+offset);
            console.log('latecy='+latecy);
        }
    });

and get:

offset=0
latecy=441

Is it mean that time is correct?



#6 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,127 posts

Posted 07 February 2019 - 07:51 PM

Yes, that means your time is correct. So your secret isn't.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users