Created
May 30, 2014 21:52
-
-
Save Syfaro/dcf348ab13127f056b3a to your computer and use it in GitHub Desktop.
Joins the FurCast IRC channel, spams ":3"s, then leaves and randomly joins again sometime in the next day
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
irc = require 'irc' | |
client = new irc.Client 'irc.ircfox.net', 'FoxBot' | |
String.prototype.repeat = (num) -> | |
return new Array(num + 1).join this | |
randomNumber = (min, max) -> | |
return Math.floor Math.random() * (max - min) + min | |
assault = (channel) -> | |
console.log "Assaulting #{channel}" | |
client.join channel | |
times = randomNumber 0, 15 | |
count = 0 | |
console.log "Speaking #{times} times" | |
speak = -> | |
if count > times | |
client.part channel | |
waitTime = randomNumber 1000, 1000 * 60 * 60 * 24 | |
console.log "Waiting #{waitTime}ms before next assault" | |
setTimeout -> | |
assault channel | |
, waitTime | |
return | |
repeat = randomNumber 1, 10 | |
console.log "Repeating #{repeat} times" | |
client.say channel, ':3 '.repeat repeat | |
count++ | |
messageDelay = randomNumber 1000, 5000 | |
console.log "Waiting #{messageDelay}ms before next message" | |
setTimeout speak, messageDelay | |
speak() | |
client.on 'error', (err) -> | |
console.error err | |
client.on 'registered', -> | |
assault '#furcast' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment