1 # Author: novex, daniel@novex.net.nz based on code from slap.rb by oct
3 class EightBallPlugin < Plugin
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']
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?"
11 def eightball(m, params)
12 answers = @answers[rand(@answers.length)]
13 action = "shakes the magic 8-ball... #{answers}"
14 @bot.action m.replyto, action
17 plugin = EightBallPlugin.new
18 plugin.map '8ball', :action => 'usage'
19 plugin.map '8ball *params', :action => 'eightball'