forked from haharooted/hourboosting2fa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboost.coffee
More file actions
26 lines (22 loc) · 772 Bytes
/
boost.coffee
File metadata and controls
26 lines (22 loc) · 772 Bytes
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
_ = require 'lodash'
jsonfile = require 'jsonfile'
moment = require 'moment'
Promise = require 'bluebird'
SteamAccount = require './steamaccount.coffee'
try
database = jsonfile.readFileSync 'database.json'
catch e
console.log "Error reading database.json!"
process.exit 0
pad = 24 + _.maxBy(_.keys(database), 'length').length
accounts = _.map database, ({password, sentry, secret, games}, name) ->
new SteamAccount name, password, sentry, secret, games, pad
restartBoost = ->
console.log '\n---- Restarting accounts ----\n'
Promise.map accounts, _.method 'restartGames'
.delay 1800000
.finally restartBoost
console.log '\n---- Starting to boost ----\n'
Promise.map accounts, _.method 'boost'
.delay 1800000
.then restartBoost