xonotic/server/rcon2irc/fastest_lap.pl

25 lines
756 B
Perl
Raw Normal View History

2010-03-18 13:22:15 +00:00
sub out($$@);
# chat: Xonotic server -> IRC channel, fastest record in race and ctf
2010-03-18 13:22:15 +00:00
[ dp => q{:recordset:(\d+):(.*)} => sub {
my ($id, $record) = @_;
my $nick = $store{"playernick_byid_$id"};
my $time;
if ($record < 60) {
$time = $record;
} else {
my $minutes = int($record/60);
my $seconds = $record - $minutes*60;
$time = "$minutes:$seconds";
}
if ($store{map} =~ m/^ctf_/) {
out irc => 0, "PRIVMSG $config{irc_channel} :* \00306record\017 $nick\017 set the fastest flag capture record with \00304$time\017 on \00304" . $store{map} . "\017";
} else {
out irc => 0, "PRIVMSG $config{irc_channel} :* \00306record\017 $nick\017 set the fastest lap record with \00304$time\017 on \00304" . $store{map} . "\017";
}
return 0;
} ],