]> ruin.nu Git - ndwebbie.git/blobdiff - check.pl
nicer table in check
[ndwebbie.git] / check.pl
index 1f9fd03680866328a729e720fb6ef861047ac163..788e93887fd25dee5b3ad2e12bca38a1004f9604 100644 (file)
--- a/check.pl
+++ b/check.pl
@@ -41,9 +41,9 @@ if (param('coords') =~ /(\d+)(?: |:)(\d+)(?:(?: |:)(\d+))?(?: |:(\d+))?/){
 }
 
 if (isMember() && param('cmd') eq 'arbiter'){
-       my $query = $DBH->prepare(q{SELECT count(*) AS friendlies FROM current_planet_stats WHERE x = ? AND z = ? 
+       my $query = $DBH->prepare(q{SELECT count(*) AS friendlies FROM current_planet_stats WHERE x = ? AND y = ? 
                AND (planet_status IN ('Friendly','NAP') OR relationship IN ('Friendly','NAP'))});
-       my $count = $DBH->selectrow_array($query,undef,$x,$y);
+       my ($count) = $DBH->selectrow_array($query,undef,$x,$y);
        if ($count > 0){
                $BODY->param(Arbiter => '<b>DO NOT ATTACK THIS GAL</b>');
        }else{
@@ -74,6 +74,7 @@ if (defined $z){
 }
 my @planets;
 my $planet_id = undef;
+my $i = 0;
 while (my ($id,$coords,$planet,$race,$size,$score,$value,$xp,$sizerank,$scorerank,$valuerank,$xprank
                ,$fleetvalue,$resvalue,$planet_status,$hit_us,$alliance,$relationship,$nick) = $query->fetchrow){
        $planet_id = $id;
@@ -91,6 +92,8 @@ while (my ($id,$coords,$planet,$race,$size,$score,$value,$xp,$sizerank,$scoreran
                        $LOG->execute($ND::UID,"BC browsing ND planet $coords tick $ND::TICK");
                }
        }
+       $i++;
+       $planet{ODD} = $i % 2;
        push @planets,\%planet;
 }
 $BODY->param(Planets => \@planets);