summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins/eightball.rb
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 16:32:32 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 16:32:32 +0000
commit2a96c9198c1f6e13407d0999083f6ce5e0bc06fa (patch)
treeb3b9247d275d9b554665bc22884104d266d2e757 /lib/rbot/plugins/eightball.rb
parent21949774b91eaec6ecde4eaa8ad121e2c0a36b87 (diff)
move rbot into lib - still rearranging for packaging/installation
Diffstat (limited to 'lib/rbot/plugins/eightball.rb')
-rw-r--r--lib/rbot/plugins/eightball.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/rbot/plugins/eightball.rb b/lib/rbot/plugins/eightball.rb
new file mode 100644
index 00000000..64748490
--- /dev/null
+++ b/lib/rbot/plugins/eightball.rb
@@ -0,0 +1,19 @@
+# Author: novex, daniel@novex.net.nz based on code from slap.rb by oct
+
+class EightBallPlugin < Plugin
+ def initialize
+ super
+ @answers=['yes', 'no', 'outlook not so good', 'all signs point to yes', 'all signs point to no', 'why the hell are you asking me?', 'the answer is unclear']
+ end
+ def help(plugin, topic="")
+ "magic 8-ball ruby bot module written by novex for nvinfo on #dumber@quakenet, usage:<botname> 8ball will i ever beat this cancer?"
+ end
+ def eightball(m, params)
+ answers = @answers[rand(@answers.length)]
+ action = "shakes the magic 8-ball... #{answers}"
+ @bot.action m.replyto, action
+ end
+end
+plugin = EightBallPlugin.new
+plugin.map '8ball', :action => 'usage'
+plugin.map '8ball *params', :action => 'eightball'