Skip to content

Instantly share code, notes, and snippets.

@williamokano
Created April 8, 2016 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save williamokano/2b5c858e738a7829b6481095fb5deb30 to your computer and use it in GitHub Desktop.
Save williamokano/2b5c858e738a7829b6481095fb5deb30 to your computer and use it in GitHub Desktop.
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