]> ruin.nu Git - NDIRC.git/blobdiff - PA.pm
Converted the .fco command
[NDIRC.git] / PA.pm
diff --git a/PA.pm b/PA.pm
index 1eb767520d5a478d1c475575865d7b5ea2287893..094c5671df25dcda4e952684b5db31d940a6cf8f 100644 (file)
--- a/PA.pm
+++ b/PA.pm
@@ -145,46 +145,4 @@ sub shipColor {
        return "$ND::C$c$string$ND::O";
 }
 
-sub findCovOpper {
-       my ($stolen, $command) = @_;
-
-       my $tick = $ND::tick;
-       my $agents;
-
-       if (defined $stolen && $stolen =~ /(\d+) (\d+) (\d+)/){
-               $tick = $1;
-               $agents = $2;
-               $stolen = $3;
-       }elsif (defined $stolen && $stolen =~ /(\d+) (\d+)/){
-               $agents = $1;
-               $stolen = $2;
-       }else{
-               $ND::server->command("notice $ND::nick syntax: .$command [tick] agents stolen | tick can be omitted if you're doing this the same tick you got cov opped, if you have different amount of your resources stolen, specify the highest amount. Only works if less than 10% of your resources and < 10,000*agents were stolen");
-               return;
-       }
-
-       my ($value,$score) = $ND::DBH->selectrow_array(q{
-               SELECT value,score FROM planet_stats WHERE 
-                       id = (SELECT planet FROM users WHERE hostmask ILIKE ?) AND tick = ?;
-               }, undef, $ND::address,$tick);
-       unless ($value){
-               $ND::server->command("notice $ND::nick No value found for tick $tick, can't find your cov opper.");
-               return;
-       }
-       my $attackers = $ND::DBH->prepare(q{
-               SELECT coords(p.x,p.y,p.z), ruler, planet FROM current_planet_stats p JOIN planet_stats ps using (id) WHERE 
-               ps.tick = $1 AND (2000.0*$2*$3/ps.value)::int = $4 ;
-               });
-       $attackers->execute($tick,$agents,$value,$stolen);
-       if ($attackers->rows == 0){
-               $ND::server->command("notice $ND::nick No cov opper found, did you specify the right tick, and was the stolen amount not capped?");
-               return;
-       }
-       my $coords = '';
-       while (my $attacker = $attackers->fetchrow_hashref){
-               $coords .= " ($attacker->{coords} : $attacker->{ruler} OF $attacker->{planet})";
-       }
-       $ND::server->command("notice $ND::nick The planet that cov opped you is one of: $coords");
-}
-
 1;