Created
February 16, 2012 03:41
-
-
Save erikbuild/1841714 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'ponder' | |
@ponder = Ponder::Thaum.new | |
@ponder.configure do |c| | |
c.nick = 'FUN_BOT' | |
c.username = 'FUN_BOT' | |
c.real_name = 'FUN_BOT' | |
c.server = 'jigokuarashi.ssarkars.net' | |
c.port = 6668 | |
end | |
@channel = '#chat' | |
@ponder.on :connect do | |
@ponder.join @channel | |
end | |
#@ponder.on :join, /Darcy/ do |event_data| | |
# @ponder.kick @channel, 'Darcy', 'Sorry, you rolled a 3 or lower. Try again later.' if (Random.new.rand(0..20) < 3) | |
#end | |
@valid_nicks = ['kelleh', '_31415_', 'audioHack', 'JinzoBlazer', 'CrazyManFish', 'JinzoBlazer-Netbook', 'JinzoPhone', 'audioHack-m'] | |
@ponder.on :query, // do |event_data| | |
nick = event_data[:nick] | |
if @valid_nicks.include?(nick) then | |
case event_data[:message] | |
when /\/kick \S+/ | |
@ponder.kick @channel, $1 | |
when /\/topic \S+/ | |
@ponder.topic @channel, $1 | |
when /\/mode \S+ \S+/ | |
puts "1: #{$1}. 2: #{$2}" | |
@ponder.mode $2, $1 | |
else | |
@ponder.message @channel, event_data[:message] | |
end | |
end | |
end | |
@minerals = ["http://en.wikipedia.org/wiki/Buddingtonite", "http://en.wikipedia.org/wiki/Chromium", "http://en.wikipedia.org/wiki/Frankhawthorneite"] | |
@ponder.on :channel, /\+roks/ do |event_data| | |
@ponder.message @channel, @minerals[Random.new.rand(0..2)] | |
end | |
@ponder.connect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment