2 use POSIX qw(ceil floor);
3 # chat: Nexuiz server -> IRC channel, fastest record in nexrun and ctf
4 [ dp => q{:recordset:(\d+):(.*)} => sub {
5 my ($id, $record) = @_;
6 my $recordnick = $id ? $store{"playernick_byid_$id"} : "(console)";
7 my $minutes = $record/60;
8 my $seconds = $record%60;
9 my $ms = int(($record - floor($record))*1000000);
12 $time = "\003040:0.$ms";
13 } elsif($minutes < 1) {
14 $time = "\003040:$seconds.$ms";
16 $time = "\00304$minutes:$seconds.$ms";
18 my $mapname = $store{"map"};
19 if ($mapname =~ m/^ctf_/) {
20 out irc => 0, "PRIVMSG $config{irc_channel} :* \00304$recordnick\017 set the \00304all-time fastest flag capture \00304record\017 with $time ($mapname)";
22 out irc => 0, "PRIVMSG $config{irc_channel} :* \00304$recordnick\017 set the \00304all-time fastest lap \00304record\017 with $time ($mapname)";