Skip to content
Browse files

Evil knows how to dance now, and back to being able to stop the Evil

  • Loading branch information...
1 parent a7193c2 commit 145840468817cfcfd9771be85669434e7ae36175 Jason Roelofs committed Nov 17, 2009
Showing with 25 additions and 1 deletion.
  1. +25 −1 examples/evil.bot
View
26 examples/evil.bot
@@ -13,9 +13,19 @@ class Evil
:recurse => [:really,
"Do a recursive flood on the channel. This gets out of hand really quick. Set :really as a confirmation"],
:stop_recurse => "Attempt to halt the recurse flood",
- :stop_flood => "End a currently running flood test"
+ :stop_flood => "End a currently running flood test",
+ :boogie => "Do the boogie, duh"
}
+ DANCE_STEPS = [
+ ":D|-<",
+ ":D\\-<",
+ ":D/-<",
+ ":D>-<",
+ ":D<-<",
+ ":D|-|",
+ ]
+
def on_message(sender, content, event)
puts event.inspect
@@ -46,6 +56,10 @@ class Evil
end
end
+ def die
+ EM.stop
+ end
+
def help
<<END
This is Evil Bot. I'm here to cause pain and destruction.
@@ -109,6 +123,16 @@ END
"Recurse finished, good day"
end
+ def boogie
+ @step_count = 0
+ @timer = EM::PeriodicTimer.new(1) do
+ client.send_message DANCE_STEPS[@step_count]
+ @step_count = (@step_count + 1) % DANCE_STEPS.length
+ end
+
+ "DANCE! Once you start, YOU CAN'T STOP!"
+ end
+
end
use Evil.new

0 comments on commit 1458404

Please sign in to comment.
Something went wrong with that request. Please try again.