diff planner.pl @ 285:c864134ebe3e

refined output format
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 04 Dec 2008 03:22:24 +0800
parents 8355ec8514f9
children 523ea51126bc
line wrap: on
line diff
--- a/planner.pl	Thu Dec 04 03:22:11 2008 +0800
+++ b/planner.pl	Thu Dec 04 03:22:24 2008 +0800
@@ -96,15 +96,16 @@
                 ($cities[$i+1]->{distance} - $cities[$i]->{distance}));
     }
     printf("\n# %s %s %dm\n", $cities[$i]->{name}, $cities[$i]->{type}, $cities[$i]->{distance});
+    printf("# ActionPoint %d/%d\n", $cities[$i]->{actionPoints}, $cities[$i]->{maxActionPoints});
 
     printf('$ikariam->login;' . "\n");
     if($cities[$i]->{type} eq "navy") {
         printf('$ikariam->changeCity(%d);' . "\n", $cities[$i]->{id});
         printf('$ikariam->blockadeCity(%d, {' . "\n", $targetCity->id);
-        printf('blockadeDuration => 8*60*60,' . "\n");
+        printf("\tblockadeDuration => 2*60*60," . "\n");
         while (my ($k, $v) = each(%{$cities[$i]->{fleet}})) {
             if($v > 0) {
-                printf("cargo_fleet_%s => %s, # %s \n", $fleet->{$k}, $v, $k);
+                printf("\tcargo_fleet_%s => %s, # %s \n", $fleet->{$k}, $v, $k);
             }
         }
         printf('});' . "\n", $cities[$i]->{id});
@@ -113,7 +114,7 @@
         printf('$ikariam->plunderCity(%d, {' . "\n", $targetCity->id);
         while (my ($k, $v) = each(%{$cities[$i]->{army}})) {
             if($v > 0) {
-                printf("cargo_army_%s => %s, # %s \n", $army->{$k}, $v, $k);
+                printf("\tcargo_army_%s => %s, # %s \n", $army->{$k}, $v, $k);
             }
         }
         printf('});' . "\n", $cities[$i]->{id});