Skip to content

Commit

Permalink
Evil knows how to dance now, and back to being able to stop the Evil
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Roelofs committed Nov 17, 2009
1 parent a7193c2 commit 1458404
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion examples/evil.bot
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.