-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.js
36 lines (25 loc) · 953 Bytes
/
start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var Promise, Steam, _, accounts, login, e, jsonfile, moment, pad, restartStart;
_ = require('lodash');
jsonfile = require('jsonfile');
moment = require('moment');
Promise = require('bluebird');
Steam = require('./steam.js');
try {
login = jsonfile.readFileSync('login.json');
} catch (_error) {
e = _error;
console.log("Error reading login.json!");
process.exit(0);
}
pad = 24 + _.maxBy(_.keys(login), 'length').length;
accounts = _.map(login, function(arg, name) {
var games, password, secret, sentry;
password = arg.password, sentry = arg.sentry, secret = arg.secret, games = arg.games;
return new Steam(name, password, sentry, secret, games, pad);
});
restartBoost = function() {
console.log('\nRestarting...\n');
return Promise.map(accounts, _.method('restartGames')).delay(1800000)["finally"](restartStart);
};
console.log('\nStarting...\n');
Promise.map(accounts, _.method('start')).delay(1800000).then(restartStart);