require "socket"
server = "irc.cjmz.eu"
port = "6667"
nick = "ANONYMOUS"
channel = "#cjmz-irc, #[IF]"
s = TCPSocket.open(server, port)
print("addr: ", s.addr.join(":"), "\n")
print("peer: ", s.peeraddr.join(":"), "\n")
s.puts "USER ANON 0 * ANON"
s.puts "NICK #{nick}"
s.puts "JOIN #{channel}"
s.puts "PRIVMSG #{channel} :Hello from IRB Bot\n")

until s.eof? do
  msg = s.gets
  puts msg
end

-- 
Posted via http://www.ruby-forum.com/.