Created
December 9, 2011 15:47
-
-
Save dstrelau/1452049 to your computer and use it in GitHub Desktop.
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
# <tech> is roflscale | |
responses = [ | |
"Have you thought about trying %?" | |
"The only way to scale is %." | |
"Why not just use %?" | |
"What about using %?" | |
"I heard % can handle that just fine." | |
] | |
Array::remove ?= (e) -> @[t..t] = [] if (t = @indexOf(e)) > -1 | |
module.exports = (robot) -> | |
robot.brain.data['roflscale'] = robot.brain.data['roflscale'] || [] | |
robot.respond /(.+) is roflscale/i, (msg) -> | |
if robot.brain.data['roflscale'].indexOf msg.match[1] > -1 || | |
robot.brain.data['roflscale'].push msg.match[1] | |
msg.send "Copy that." | |
robot.respond /(.+) is not roflscale/i, (msg) -> | |
if robot.brain.data['roflscale'].remove(msg.match[1]) | |
msg.send "Never thought it was." | |
robot.hear /scal(e|ability|ing)/i, (msg) -> | |
return if msg.message.match(/is (not )?roflscale/) | |
tech = msg.random robot.brain.data['roflscale'] | |
msg.send msg.random(responses).replace '%', tech if tech | |
robot.hear /speed/i, (msg) -> | |
tech = msg.random robot.brain.data['roflscale'] | |
msg.send "If you want speed, just use #{tech}." if tech |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment