Skip to content

Instantly share code, notes, and snippets.

@scholtzm
Last active October 31, 2015 21:11
Show Gist options
  • Save scholtzm/220d4f89eb2477f1d646 to your computer and use it in GitHub Desktop.
Save scholtzm/220d4f89eb2477f1d646 to your computer and use it in GitHub Desktop.
Simple Vapor-based idler
var vapor = require('vapor');
var idler = require('vapor-idler');
// Create our config object
var config = {
username: username, // Steam login
password: password, // Steam password
displayName: 'My Cool Name', // This will show up in other users' friendslists
// Admins can issue "!idle" command (via regular chat messages) to start/stop the idling process
admins: [ '7656123456', '7656789654' ]
};
// Create bot instance
var bot = vapor();
// Initialize bot with our config
bot.init(config);
// Essential stuff
bot.use(vapor.plugins.consoleLogger);
bot.use(vapor.plugins.fs);
bot.use(vapor.plugins.essentials);
bot.use(vapor.plugins.stdinSteamGuard);
// Use external 'idler' plugin
bot.use(idler, {
games: [440, 730] // array of appids (440 is TF2, 730 is CS:GO)
autoStart: true // start automatically after loggin in
});
// Start the bot
bot.connect();
// Handle SIGINT (Ctrl+C) gracefully
process.on('SIGINT', function() {
bot.disconnect();
setTimeout(process.exit, 1000, 0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment