comparison scan.pl @ 141:0da6658697df

fixed the param of islands
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 10:52:52 +0800
parents 124fc7abda39
children b7af307a222d
comparison
equal deleted inserted replaced
140:124fc7abda39 141:0da6658697df
91 $i->logout; 91 $i->logout;
92 } elsif($#ARGV == -1) { 92 } elsif($#ARGV == -1) {
93 $i->login; 93 $i->login;
94 my $cities = $i->check; 94 my $cities = $i->check;
95 foreach my $cityId (keys(%$cities)) { 95 foreach my $cityId (keys(%$cities)) {
96 printf("%s %s\n", $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y});
96 my @islands = $i->viewWorldMap( $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y}); 97 my @islands = $i->viewWorldMap( $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y});
97 saveIslands(@islands); 98 saveIslands(@islands);
98 } 99 }
99 $i->logout; 100 $i->logout;
100 } else { 101 } else {
101 die("Usage: $0\nUsage: $0 x y\n"); 102 die("Usage: $0\nUsage: $0 x y\n");
102 } 103 }
103 104
104 sub saveIslands { 105 sub saveIslands {
105 my @islands = shift; 106 my @islands = @_;
106 107
107 foreach my $h_island (@islands) 108 foreach my $h_island (@islands)
108 { 109 {
109 printf("checking island %d\n", $h_island->{id}); 110 printf("checking island %d\n", $h_island->{id});
110 111