-
-
Save williamokano/2b5c858e738a7829b6481095fb5deb30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keyFile = 'keys/' + config.bot.username + '.key'; | |
fs.readFile('polldata.json', function (err, data) { | |
if (err) { | |
logger.warn('Error reading polldata.json'); | |
} else { | |
logger.debug('Importing previous tradeoffer data'); | |
offers.pollData = JSON.parse(data); | |
} | |
}); | |
fs.readFile(keyFile, function (err, data) { | |
var loginKey = null; | |
if (!err) { | |
loginKey = data; | |
console.log('Found loginKey: ' + loginKey); | |
} | |
// Login into steam | |
client.logOn({ | |
accountName: config.bot.username, | |
password: config.bot.password, | |
rememberPassword: true, | |
loginKey: loginKey | |
}); | |
}); | |
client.on('loginKey', function (key) { | |
console.log('Got key: ' + key); | |
fs.writeFile(keyFile, key); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment