]> git.xonotic.org Git - xonotic/xonotic.git/blob - server/rcon2irc/fastest_lap.pl
get a nick before pinging, servers don't seem to like it otherwise and return 451...
[xonotic/xonotic.git] / server / rcon2irc / fastest_lap.pl
1 sub out($$@);
2
3 # chat: Xonotic server -> IRC channel, fastest record in race and ctf
4 [ dp => q{:recordset:(\d+):(.*)} => sub {
5         my ($id, $record) = @_;
6         my $nick = $store{"playernick_byid_$id"};
7         
8         my $time;
9         if ($record < 60) {
10                 $time = $record;
11         } else {
12                 my $minutes = int($record/60);
13                 my $seconds = $record - $minutes*60;
14                 $time = "$minutes:$seconds";
15         }
16         
17         if ($store{map} =~ m/^ctf_/) {
18                 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";
19         } else {
20                 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";
21         }
22         
23         return 0;
24 } ],