--- deliantra/maps/perl/schmorp-irc.ext 2006/10/01 18:18:34 1.17 +++ deliantra/maps/perl/schmorp-irc.ext 2006/10/01 23:57:54 1.18 @@ -5,7 +5,7 @@ # requires: commands.ext -return unless $cf::CFG{irc_server}; +return unless exists $cf::CFG{irc_server}; my $BOTSERVER = $cf::CFG{irc_server}; my $BOTPORT = $cf::CFG{irc_port}; @@ -93,14 +93,5 @@ ); } -my $timer; +Event->timer (after => 1, interval => 30, cb => \&check_connection); -sub new_timer { - $timer = AnyEvent->timer (after => 10, cb => sub { - check_connection (); - &new_timer; # and restart the time - }); -} - -new_timer; # create first timer -check_connection ();