1 # Example how to do redirections, we'll grab the output of /WHOIS:
3 # /RN - display real name of nick
8 use vars qw($VERSION %IRSSI);
12 authors => 'Timo Sirainen',
14 description => 'Redirection example',
15 license => 'Public Domain'
19 my ($data, $server, $channel) = @_;
21 # ignore all whois replies except "No such nick" or the
22 # first line of the WHOIS reply
23 $server->redirect_event('whois', 1, $data, -1, '', {
24 'event 402' => 'event 402',
25 'event 401' => 'event 401',
26 'event 311' => 'redir whois',
27 '' => 'event empty' });
29 $server->send_raw("WHOIS :$data");
33 my ($num, $nick, $user, $host, $empty, $realname) = split(/ +/, $_[1], 6);
36 Irssi::print("%_$nick%_ is $realname");
39 Irssi::command_bind('rn', 'cmd_realname');
40 Irssi::signal_add('redir whois', 'event_rn_whois');