comparison 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
comparison
equal deleted inserted replaced
7:2040ccc95670 8:e4b3168d0319
5 package main; 5 package main;
6 6
7 my $i = new Ikariam("s2.ikariam.tw", "chihchun", "c795d57d"); 7 my $i = new Ikariam("s2.ikariam.tw", "chihchun", "c795d57d");
8 $i->login; 8 $i->login;
9 9
10 my @islands; 10 if($#ARGV == 1) {
11 if($#ARGV >= 1) {
12 @islands = $i->viewWorldMap($ARGV[0], $ARGV[1]); 11 @islands = $i->viewWorldMap($ARGV[0], $ARGV[1]);
12 } elsif($#ARGV == -1) {
13 @islands = $i->viewHomeMap();
13 } else { 14 } else {
14 @islands = $i->viewHomeMap(); 15 die("Usage: $0\nUsage: $0 x y\n");
15 } 16 }
16 17
18 my @islands;
17 foreach my $island (@islands) 19 foreach my $island (@islands)
18 { 20 {
19 printf("checking island %d\n", $island->{id}); 21 printf("checking island %d\n", $island->{id});
20 if(my $c = Ikariam::Island->retrieve($island->{id})) { 22 if(my $c = Ikariam::Island->retrieve($island->{id})) {
21 foreach my $i (keys(%$island)) { 23 foreach my $i (keys(%$island)) {