Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. var Steam = require('steam');
  2. var SteamUser = require('steam-user');
  3. var SteamTotp = require('steam-totp');
  4. var TOTP = require('onceler').TOTP;
  5.  
  6.  
  7. var identitysecret = 'R3lq8hcT3+3VA+gM3eGn5hP9FG8='; // It's required to confirm mobile confirmations
  8. var sharedsecret = '4icVyIRwSwfwenERFMHaIEvVmlw='; // You won't be able to log in without this code
  9.  
  10. // LOGIN DETAILS
  11.  
  12.  
  13. {
  14. console.log('[STEAM] logging in without sentry');
  15. bot.logOn({
  16. accountName: '...',
  17. password: '...',
  18. authCode: 'SteamTotp.generateAuthCode(sharedsecret)'
  19. });
  20. }
  21. bot.on('loggedOn', function() {
  22. console.log('[STEAM] Logged in.');
  23. bot.setPersonaState(Steam.EPersonaState.Online);
  24. //Tell steam we are playing games.
  25. //440=tf2
  26. //550=l4d2
  27. //730=csgo
  28. //570=dota2
  29. bot.gamesPlayed([730]);
  30. });
  31.  
  32. bot.on('sentry', function(sentryHash)
  33. {//A sentry file is a file that is sent once you have
  34. //passed steamguard verification.
  35. console.log('[STEAM] Received sentry file.');
  36. fs.writeFile('sentryfile',sentryHash,function(err) {
  37. if(err){
  38. console.log(err);
  39. } else {
  40. console.log('[FS] Saved sentry file to disk.');
  41. }});
  42. });
  43.  
  44. //Handle logon errors
  45. bot.on('error', function(e) {
  46. console.log('[STEAM] ERROR - Logon failed');
  47. if (e.eresult == Steam.EResult.InvalidPassword)
  48. {
  49. console.log('Reason: invalid password');
  50. }
  51. else if (e.eresult == Steam.EResult.AlreadyLoggedInElsewhere)
  52. {
  53. console.log('Reason: already logged in elsewhere');
  54. }
  55. else if (e.eresult == Steam.EResult.AccountLogonDenied)
  56. {
  57. console.log('Reason: logon denied - steam guard needed');
  58. }
  59. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement