Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. var steam = require('steam');
  2. // just for swagger
  3. var shuffleArray = function(array) {
  4. for (var i = array.length - 1; i > 0; i--) {
  5. var j = Math.floor(Math.random() * (i + 1));
  6. var temp = array[i];
  7. array[i] = array[j];
  8. array[j] = temp;
  9. }
  10. return array;
  11. }
  12. var accounts = [
  13. {
  14. username: user,
  15. password: pass,
  16. authcode: code,
  17. games: "[" + games + "]",
  18. loggedIn: false
  19. }
  20. ];
  21. var build = function() {
  22. for (var index in accounts) {
  23. buildBot(index);
  24. }
  25. }
  26. var buildBot = function(index) {
  27. var account = accounts[index];
  28. var username = account.username;
  29. var password = account.password;
  30. var authcode = account.authcode;
  31. var sentryFileHash = new Buffer(username).toString('base64');
  32. var bot = new steam.SteamClient();
  33. console.log("[BOT][" + username + "]: Login without sentry file.");
  34. bot.logOn({
  35. accountName: username,
  36. password: password,
  37. authCode: '',
  38. twoFactorCode: authcode
  39. });
  40. bot.on('loggedOn', function() {
  41. console.log("[BOT][" + username + "]: Login Succesful!");
  42. account.loggedIn = true;
  43. bot.setPersonaState(steam.EPersonaState.Online);
  44. gameToPlay = shuffleArray(account.games);
  45. bot.gamesPlayed(JSON.parse(gameToPlay));
  46. console.log("[BOT][" + username + "]: Playing games: " + gameToPlay);
  47.  
  48. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement