Skip to content

Instantly share code, notes, and snippets.

@hokkai7go
Forked from onodes/gist:172833
Created August 24, 2009 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hokkai7go/173818 to your computer and use it in GitHub Desktop.
Save hokkai7go/173818 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'net/irc'
class ExampleClient < Net::IRC::Client
def hash_make
@hash = Hash.new
@hash["hokkai7go"] = 0.to_i
end
def on_rpl_welcome(m)
hash_make
post JOIN, opts.channel
end
def on_privmsg(m)
channel, message = *m
if message.include?("hokkai7go--") && m.prefix.nick == "reath"
post PRIVMSG, channel, "hokkai7go++"
end
if message.include?("reath--") && m.prefix.nick != "hokkai7go"
post PRIVMSG, channel, "reath--"
end
end
end
client = ExampleClient.new("irc.tokyo.wide.ad.jp", 6667,
{:nick => "hokkai_r", :user => "hokkai_r", :real => "hokkai_r",
:channel => "#LOCAL-students"}
)
client.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment