diff scan.pl @ 8:e4b3168d0319

implemented sheep and enemy scripts.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 08 Oct 2008 04:23:01 +0800
parents 2040ccc95670
children f590b5ea5e55
line wrap: on
line diff
--- a/scan.pl	Wed Oct 08 02:50:19 2008 +0800
+++ b/scan.pl	Wed Oct 08 04:23:01 2008 +0800
@@ -7,13 +7,15 @@
 my $i = new Ikariam("s2.ikariam.tw", "chihchun", "c795d57d");
 $i->login;
 
-my @islands;
-if($#ARGV >= 1) {
+if($#ARGV == 1) {
     @islands = $i->viewWorldMap($ARGV[0], $ARGV[1]);
+} elsif($#ARGV == -1) {
+    @islands = $i->viewHomeMap();
 } else {
-    @islands = $i->viewHomeMap();
+    die("Usage: $0\nUsage: $0 x y\n");
 }
 
+my @islands;
 foreach my $island (@islands)
 {
     printf("checking island %d\n", $island->{id});