Last active
October 31, 2015 21:11
-
-
Save scholtzm/220d4f89eb2477f1d646 to your computer and use it in GitHub Desktop.
Simple Vapor-based idler
This file contains hidden or 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 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