Mercurial > eagle-eye
annotate enemy.pl @ 18:fd44e3a1f800
fixed the cache.
show tradegoodText of sheeps.
refined enemy.pl
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Wed, 08 Oct 2008 16:10:01 +0800 |
parents | e4b3168d0319 |
children | 5635e75c92d0 |
rev | line source |
---|---|
8
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
1 #!/usr/bin/perl |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
2 use strict; |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
3 use Ikariam; |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
4 use Data::Dumper; |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
5 |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
6 package main; |
18 | 7 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/; |
8 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/; | |
8
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
9 |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
10 if($#ARGV != 0) { |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
11 die("Usage: $0 nickname\n"); |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
12 } |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
13 |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
14 Ikariam::User->has_many(cities => 'Ikariam::Cities'); |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
15 my ($u) = Ikariam::User->search('name' => $ARGV[0]); |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
16 if(defined($u)) { |
18 | 17 foreach my $i (qw/name score trader_score_secondary army_score_main ally/) { |
18 printf("%s: %s\n", $i, $u->get($i)); | |
19 } | |
20 printf("\nCities\n"); | |
21 # print Dumper($u->_data_hash); | |
22 foreach my $city ($u->cities) { | |
23 my $island = Ikariam::Island->retrieve($city->island); | |
24 printf("Name: %s\n", $city->cityname); | |
25 printf("Level: %s\n", $city->citylevel); | |
26 printf("Island: %s\n", $island->name); | |
27 printf("Location: [%s:%s] http://s2.ikariam.tw/index.php?view=island&id=%s\n", $island->x, $island->y, $island->id); | |
28 printf("Tradegood: %s\n", $tradegoodText[$island->tradegood]); | |
29 printf("Wonder: %s\n\n", $wonderText[$island->wonder]); | |
30 # print Dumper($island->_data_hash); | |
31 # print Dumper($city->_data_hash); | |
8
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
32 } |
e4b3168d0319
implemented sheep and enemy scripts.
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
33 } |