changeset 89:86402d28544f

stop upgrade townHall after the level is 20.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 26 Oct 2008 16:20:48 +0800
parents 0fa9cd836e1e
children ba96a3f8f522
files agent.pl scan.pl
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Sun Oct 26 16:12:03 2008 +0800
+++ b/agent.pl	Sun Oct 26 16:20:48 2008 +0800
@@ -39,6 +39,7 @@
     my ($self, $city) = @_;
     # TODO 應該以消耗率/時間計算
     # $self->{ikariam}->{growth}
+    return 1 if($city->{buildings}->{townHall} >= 20);
     return ($city->{space}->{total} <= ($city->{space}->{occupied}+6) ?  0 : 1)
 }
 
--- a/scan.pl	Sun Oct 26 16:12:03 2008 +0800
+++ b/scan.pl	Sun Oct 26 16:20:48 2008 +0800
@@ -86,7 +86,7 @@
     my @cities = $i->viewIsland($island);
     saveCities($island, @cities);
     $i->logout;
-    return;
+    exit;
 } elsif($#ARGV == -1) {
     $i->login;
     @islands = $i->viewHomeMap();