Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var steam = require('steam');
- // just for swagger
- var shuffleArray = function(array) {
- for (var i = array.length - 1; i > 0; i--) {
- var j = Math.floor(Math.random() * (i + 1));
- var temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- }
- return array;
- }
- var accounts = [
- {
- username: user,
- password: pass,
- authcode: code,
- games: "[" + games + "]",
- loggedIn: false
- }
- ];
- var build = function() {
- for (var index in accounts) {
- buildBot(index);
- }
- }
- var buildBot = function(index) {
- var account = accounts[index];
- var username = account.username;
- var password = account.password;
- var authcode = account.authcode;
- var sentryFileHash = new Buffer(username).toString('base64');
- var bot = new steam.SteamClient();
- console.log("[BOT][" + username + "]: Login without sentry file.");
- bot.logOn({
- accountName: username,
- password: password,
- authCode: '',
- twoFactorCode: authcode
- });
- bot.on('loggedOn', function() {
- console.log("[BOT][" + username + "]: Login Succesful!");
- account.loggedIn = true;
- bot.setPersonaState(steam.EPersonaState.Online);
- gameToPlay = shuffleArray(account.games);
- bot.gamesPlayed(JSON.parse(gameToPlay));
- console.log("[BOT][" + username + "]: Playing games: " + gameToPlay);
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement