Mercurial > eagle-eye
view scan.pl @ 2:0fb73a7a0b94
ok, we done basic island scanning functions.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Tue, 07 Oct 2008 23:22:09 +0800 |
parents | f9eac5385dc0 |
children | dbb97c4265ba |
line wrap: on
line source
#!/usr/bin/perl use strict; use Ikariam; package main; my $i = new Ikariam("s2.ikariam.tw", "chihchun", "c795d57d"); $i->login; my @islands; if($#ARGV >= 2) { @islands = $i->viewWorldMap($ARGV[0], $ARGV[1]); } else { @islands = $i->viewHomeMap(); } # my @islands = $i->viewWorldMap(50, 34); foreach my $island (@islands) { printf("checking island %d\n", $island->{id}); if(my $c = Ikariam::Islands->retrieve($island->{id})) { foreach my $i (keys(%$island)) { eval($c->$i($island->{$i})); } } else { Ikariam::Islands->insert($island); } # scanning the island my @cities = $i->viewIsland($island->{id}); foreach my $city (@cities) { $city->{island} = $island->{id}; if(my $c = Ikariam::Cities->retrieve($city->{cityId})) { #foreach my $i (keys(%$city)) #{ # eval($c->$i($city->{$i})); # printf("%s %s ", $i, $city->{$i}); #} #print ("\n"); $c->autoupdate(1); $c->update(); } else { Ikariam::Cities->insert($city); } printf("city %d %s saved\n", $city->{cityId}, $city->{cityname}); } } # TODO # $i->worldmap($x, $y); # http://s2.ikariam.tw/index.php?view=worldmap_iso # xajax getMapData # xajaxargs[] 54 # xajaxargs[] 30 # xajaxr 1223302744553 # $i->getAcount() account database. # 經濟, 軍事 # http://s2.ikariam.tw/index.php # view highscore # highscoreType score # offset -1 # searchUser chihchun # $i->getCityInfo();