#!/usr/local/bin/ruby
require 'net/irc'
class SimpleClient < Net::IRC::Client
def on_rpl_welcome(m)
super
post JOIN, '#onelirc'
post NOTICE, '#onelirc', 'Hi'
sleep 5
finish
end
def on_error(m)
finish
end
def on_err_nicknameinuse(m)
super
$stderr.puts 'NICKNAME ALREADY INS USE ERRORRRRRRRRRRRRRRRRRRRRRRRRR'
post NICK, 'another'# some server rejects multi-client connection
sleep 3
end
end
SimpleClient.new('irc.trpg.net', '6667',
nick: 'onelirc',
user: 'onelirc',
real: 'onelirc'
).start
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
11