Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
# CopyLeft Riku Voipio 2001
# half-life bot script
use strict;
use Irssi;
use Irssi::Irc;
use vars qw($VERSION %IRSSI);
# header begins here
$VERSION = "1.2";
%IRSSI = (
authors => "Riku Voipio",
contact => "riku.voipio\",
name => "half-life",
description => "responds to \"!hl counterstrike.server \" command on channels/msg's to query counter-strike servers",
license => "GPLv2",
url => "",
my $qdir="/home/nchip/qstat/";
sub cmd_hl {
my ($server, $data, $nick, $mask, $target) =@_;
if ($data=~/^!hl/){
my @foo=split(/\s+/,$data);
my $len=@foo;
if ($len==1){
#fixme, haxxor protection
my $word=$foo[1];
$word=~s/[^a-zA-ZäöÄÖ0-9\.]/ /g;
open(DAT, "-|", $qdir."qstat -hls $word");
my $count=0;
foreach my $line (<DAT>)
if ($count==1)
$line=~s/\s+/ /g;
$server->command("/notice ".$target." ".$line);
Irssi::signal_add_last('message public', 'cmd_hl');
Irssi::print("Half-life info bot by nchip loaded.");