diff inactive-map.pl @ 116:da0dd597401c

fixed the x/y position
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 29 Oct 2008 23:08:38 +0800
parents e992576ac97c
children
line wrap: on
line diff
--- a/inactive-map.pl	Wed Oct 29 17:53:46 2008 +0800
+++ b/inactive-map.pl	Wed Oct 29 23:08:38 2008 +0800
@@ -10,13 +10,13 @@
 Ikariam::User->set_sql(inactivity => qq {
     SELECT user.id 
       FROM user, cities, island
-      WHERE user.id == cities.user
-        AND cities.island == island.id
+      WHERE user.id = cities.user
+        AND cities.island = island.id
         AND island.x <= ?
         AND island.x >= ?
         AND island.y <= ?
         AND island.y >= ?
-        AND cities.status == 'i'
+        AND cities.status = 'i'
     }
 );
 #Ikariam::User->set_sql(sheeps => qq {
@@ -36,9 +36,9 @@
 Ikariam::User->set_sql(sheeps => qq {
         SELECT user.id 
           FROM user, cities 
-         WHERE user.id == cities.user 
-           AND cities.status == 'i'
-           AND user.trader_score_secondary >= 50000 
+         WHERE user.id = cities.user 
+           AND cities.status = 'i'
+           AND user.trader_score_secondary >= 50000
            AND user.army_score_main <= 40
     }
 );
@@ -69,7 +69,7 @@
             # 所得金錢 = 對方城鎮等級x(對方城鎮等級-1)x對方金錢/10000
             my $robbery = $c->citylevel * ($c->citylevel - 1) * $sheep->trader_score_secondary / 10000;
 
-            next if($robbery < 2000);
+            next if($robbery < 1000);
 
             $maps{$island->x}{$island->y}{'id'} = $island->id;
             $maps{$island->x}{$island->y}{'density'} += 1;
@@ -95,16 +95,16 @@
         }
         </style></head><body><table border=1>");
 
-    foreach my $x ($x1..$x2)
+    foreach my $y($y1..$y2)
     {
         print(OUT "<tr>");
-        foreach my $y($y1..$y2)
+        foreach my $x ($x1..$x2)
         {
             # printf("<div stlye='float:left; background-color: black; padding: 0; Display:inline;'>o</div>");
             if(defined($maps{$x}{$y}{'density'})) {
                 my $c = 255 - (15 * $maps{$x}{$y}{'density'});
-                printf(OUT "<td style=\"background-color: rgb(255,%d,%d);\"><a href=\"http://s2.ikariam.tw/index.php?view=island&id=%d\" title=\"[%d,%d] (%d)\">[%d,%d]</a></td>",
-                    $c, $c, $maps{$x}{$y}{'id'}, $x, $y, $maps{$x}{$y}{'density'}, $x, $y);
+                printf(OUT "<td style=\"background-color: rgb(255,%d,%d);\"><a href=\"http://%s/index.php?view=island&id=%d\" title=\"[%d,%d] (%d)\">[%d,%d]</a></td>",
+                    $c, $c, $::server, $maps{$x}{$y}{'id'}, $x, $y, $maps{$x}{$y}{'density'}, $x, $y);
             } else {
                 printf(OUT "<td style=\"background-color: rgb(255,255,255);\">[%d,%d]</td>", $x, $y);
             }