diff options
| author | David Leadbeater | 2015-01-10 17:50:12 +0000 |
|---|---|---|
| committer | David Leadbeater | 2015-01-10 17:50:12 +0000 |
| commit | 3350aef6b04f0d33ad52b41179c6742a98d2aa1f (patch) | |
| tree | 287ac1dba07509317309acab3161f5da286958e9 /scripts/hl.pl | |
| parent | 1bae3cffef57d4d46d0230aa4f44cc52c7671b93 (diff) | |
| parent | 2d920d6f610e176bf121f9089f21956595df70e9 (diff) | |
| download | scripts.irssi.org-3350aef6b04f0d33ad52b41179c6742a98d2aa1f.tar.bz2 | |
Merge branch 'obfuscoder-perlcritic-e-l' into gh-pages
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."); - - |
