summaryrefslogtreecommitdiff
path: root/rbot/plugins/eightball.rb
blob: 6d123b34f5a4f6a4dddde5233aee7d6f3db68a1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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 privmsg(m)
    answers = @answers[rand(@answers.length)]
    action = "shakes the magic 8-ball... #{answers}"
    @bot.action m.replyto, action
  end
end
plugin = EightBallPlugin.new
plugin.register("8ball")