changeset 56:6e0d5e781949

fixed a typo in agent.pl
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 21 Oct 2008 00:00:33 +0800
parents ff00d108e955
children 9307c559f9bf d26eea95c52d
files Ikariam.pm agent.pl building.yaml
diffstat 3 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Ikariam.pm	Mon Oct 20 23:44:45 2008 +0800
+++ b/Ikariam.pm	Tue Oct 21 00:00:33 2008 +0800
@@ -18,7 +18,7 @@
 use Data::Dumper;
 use LWP;
 # use LWP::Debug qw(+ -conns -trace -debug);
-use LWP::Debug qw(+trace);
+# use LWP::Debug qw(+trace);
 use HTTP::Cookies;
 use WWW::Mechanize;
 use HTML::TagParser;
--- a/agent.pl	Mon Oct 20 23:44:45 2008 +0800
+++ b/agent.pl	Tue Oct 21 00:00:33 2008 +0800
@@ -87,10 +87,10 @@
     my @marble = qw/undef 0 0 17 28 66 95 156 243 406 579 799 1348 2124 2951 4409 6461 8187 10176 12466 15082 18055 21381 25116 100464 200928 401856 803712 1607424 3214848 6429696 12859392/;
 
     my $level = $city->{buildings}->{townHall};
-    if($city->{resources}->{woold} >= $wood[$level] && $city->{resources}->{marble} >= $marble[$level] ) {
+    if($city->{resources}->{wood} >= $wood[$level] && $city->{resources}->{marble} >= $marble[$level] ) {
         return 1;
     }
-    warn("Resource is short for build city hall.");
+    warn(sprintf("Resource is short for build city hall. wood [%d] marble [%d] ", $wood[$level], $marble[$level]));
     return 0;
 }
 
--- a/building.yaml	Mon Oct 20 23:44:45 2008 +0800
+++ b/building.yaml	Tue Oct 21 00:00:33 2008 +0800
@@ -6,7 +6,8 @@
     0:
       - is_constructing:
          # already building something.
-         1: 
+         1:
+           # adjust human resources
          # let's find something to build up
          0:
             # 確認是否為主城