Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Steam = require('steam');
- var SteamUser = require('steam-user');
- var SteamTotp = require('steam-totp');
- var TOTP = require('onceler').TOTP;
- var identitysecret = 'R3lq8hcT3+3VA+gM3eGn5hP9FG8='; // It's required to confirm mobile confirmations
- var sharedsecret = '4icVyIRwSwfwenERFMHaIEvVmlw='; // You won't be able to log in without this code
- // LOGIN DETAILS
- {
- console.log('[STEAM] logging in without sentry');
- bot.logOn({
- accountName: '...',
- password: '...',
- authCode: 'SteamTotp.generateAuthCode(sharedsecret)'
- });
- }
- bot.on('loggedOn', function() {
- console.log('[STEAM] Logged in.');
- bot.setPersonaState(Steam.EPersonaState.Online);
- //Tell steam we are playing games.
- //440=tf2
- //550=l4d2
- //730=csgo
- //570=dota2
- bot.gamesPlayed([730]);
- });
- bot.on('sentry', function(sentryHash)
- {//A sentry file is a file that is sent once you have
- //passed steamguard verification.
- console.log('[STEAM] Received sentry file.');
- fs.writeFile('sentryfile',sentryHash,function(err) {
- if(err){
- console.log(err);
- } else {
- console.log('[FS] Saved sentry file to disk.');
- }});
- });
- //Handle logon errors
- bot.on('error', function(e) {
- console.log('[STEAM] ERROR - Logon failed');
- if (e.eresult == Steam.EResult.InvalidPassword)
- {
- console.log('Reason: invalid password');
- }
- else if (e.eresult == Steam.EResult.AlreadyLoggedInElsewhere)
- {
- console.log('Reason: already logged in elsewhere');
- }
- else if (e.eresult == Steam.EResult.AccountLogonDenied)
- {
- console.log('Reason: logon denied - steam guard needed');
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement