diff options
Diffstat (limited to 'scripts/hl.pl')
| -rw-r--r-- | scripts/hl.pl | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/hl.pl b/scripts/hl.pl index 3c28cd9..7fd898d 100644 --- a/scripts/hl.pl +++ b/scripts/hl.pl @@ -1,5 +1,6 @@ # CopyLeft Riku Voipio 2001 # half-life bot script +use strict; use Irssi; use Irssi::Irc; use vars qw($VERSION %IRSSI); @@ -17,23 +18,23 @@ $VERSION = "1.2"; ); -$qdir="/home/nchip/qstat/"; +my $qdir="/home/nchip/qstat/"; sub cmd_hl { my ($server, $data, $nick, $mask, $target) =@_; if ($data=~/^!hl/){ - @foo=split(/\s+/,$data); - $len=@foo; + my @foo=split(/\s+/,$data); + my $len=@foo; if ($len==1){ $foo[1]="turpasauna.taikatech.com"; } #fixme, haxxor protection - $word=$foo[1]; + my $word=$foo[1]; $_=$word; $word=~s/[^a-zA-ZäöÄÖ0-9\.]/ /g; - open(DAT, "$qdir"."qstat -hls ".$word."|"); - $count=0; - foreach $line (<DAT>) + open(DAT, "-|", $qdir."qstat -hls $word"); + my $count=0; + foreach my $line (<DAT>) { if ($count==1) { @@ -50,5 +51,3 @@ sub cmd_hl { Irssi::signal_add_last('message public', 'cmd_hl'); Irssi::print("Half-life info bot by nchip loaded."); - - |
