1 | #! perl |
1 | #! perl |
|
|
2 | |
2 | use Time::HiRes; |
3 | use Time::HiRes; |
3 | use Net::IRC3::Client::Connection; |
4 | use Net::IRC3::Client::Connection; |
4 | |
5 | |
5 | my $BOTSERVER = 'irc.plan9.de'; |
6 | my $BOTSERVER = 'irc.plan9.de'; |
6 | my $BOTPORT = '6667'; |
7 | my $BOTPORT = '6667'; |
… | |
… | |
19 | $CON->send_chan ($BOTCHAN, NOTICE => $msg, $BOTCHAN); |
20 | $CON->send_chan ($BOTCHAN, NOTICE => $msg, $BOTCHAN); |
20 | } |
21 | } |
21 | |
22 | |
22 | sub check_connection { |
23 | sub check_connection { |
23 | return if $CON; |
24 | return if $CON; |
|
|
25 | |
24 | $CON = Net::IRC3::Client::Connection->new; |
26 | $CON = Net::IRC3::Client::Connection->new; |
25 | $CON->connect ($BOTSERVER, $BOTPORT); |
27 | $CON->connect ($BOTSERVER, $BOTPORT); |
26 | $CON->send_srv (JOIN => undef, $BOTCHAN); |
28 | $CON->send_srv (JOIN => undef, $BOTCHAN); |
27 | $CON->register ($BOTNAME, $BOTNAME, 'crossfire connection'); |
29 | $CON->register ($BOTNAME, $BOTNAME, 'crossfire connection'); |
28 | $CON->reg_cb ( |
30 | $CON->reg_cb ( |