Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By default equires a JSON file with your steam account data,
- // as defined with the PATH variable.
- // You can just define the accounts object yourself, just make sure
- // to use the correct property names.
- require('console-stamp')(console, 'HH:MM:ss.l') // npm install console-stamp - or just comment out if you don't need timestamps
- const SteamUser = require('steam-user') // npm install steam-user
- const steamtotp = require('steam-totp') // npm install steam-totp
- const fs = require('fs')
- const rs = require('readline').createInterface({
- input: process.stdin,
- output: process.stdout
- })
- const PATH = 'steamdata.json'
- const GAMES = [730]
- let data
- if (fs.existsSync(PATH)) {
- data = JSON.parse(fs.readFileSync(PATH))
- } else throw 'Steam account data file not found.'
- let account = data.main // If you are lazy and don't want to deal with JSON files, just comment some stuff above and add an object with the data here.
- function hide (client) {
- client.gamesPlayed([399220, 399080, 399480])
- console.log(`Attempted to hide recent games.`)
- }
- function login (client) {
- client.logOn({
- accountName: account.name,
- password: account.password
- })
- }
- let client = new SteamUser()
- client.setOption('promptSteamGuardCode', false)
- login(client)
- client.on('steamGuard', (domain, callback) => {
- console.log(`steamGuard event received.`)
- if (account.shasec) {
- steamtotp.getAuthCode(account.shasec, (err, code, offset, latency) => {
- if (err) throw err
- console.log(`Got mobile auth code (${code}) with a delay of ${latency} ms.`)
- callback(code)
- })
- } else {
- rs.question(`${domain ? 'Email' : 'Mobile'} code: `, code => callback(code))
- }
- })
- client.on('loggedOn', details => {
- console.log(`Logged on from ${details.public_ip}.`)
- hide(client)
- setInterval(hide, 2*60*1000, client)
- })
- client.on('error', err => {
- let i = (err.message === 'RateLimitExceeded' ? 30*60*1000 : 2*60*1000)
- console.log(`Error '${err.message}' catched, retrying in ${(i/1000)/60} minutes.`)
- client.logOff()
- setTimeout(login, i, client)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement