]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - rbot/plugins/eightball.rb
initial import of rbot
[user/henk/code/ruby/rbot.git] / rbot / plugins / eightball.rb
1 # Author: novex, daniel@novex.net.nz based on code from slap.rb by oct
2
3 class EightBallPlugin < Plugin
4   def initialize
5     super
6     @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']
7   end
8   def help(plugin, topic="")
9     "magic 8-ball ruby bot module written by novex for nvinfo on #dumber@quakenet, usage:<botname> 8ball will i ever beat this cancer?"
10   end
11   def privmsg(m)
12     answers = @answers[rand(@answers.length)]
13     action = "shakes the magic 8-ball... #{answers}"
14     @bot.action m.replyto, action
15   end
16 end
17 plugin = EightBallPlugin.new
18 plugin.register("8ball")