comparison 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
comparison
equal deleted inserted replaced
17:5ea88404dc74 18:fd44e3a1f800
2 use strict; 2 use strict;
3 use Ikariam; 3 use Ikariam;
4 use Data::Dumper; 4 use Data::Dumper;
5 5
6 package main; 6 package main;
7 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/;
8 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/;
7 9
8 if($#ARGV != 0) { 10 if($#ARGV != 0) {
9 die("Usage: $0 nickname\n"); 11 die("Usage: $0 nickname\n");
10 } 12 }
11 13
12 Ikariam::User->has_many(cities => 'Ikariam::Cities'); 14 Ikariam::User->has_many(cities => 'Ikariam::Cities');
13 my ($u) = Ikariam::User->search('name' => $ARGV[0]); 15 my ($u) = Ikariam::User->search('name' => $ARGV[0]);
14 if(defined($u)) { 16 if(defined($u)) {
15 print Dumper($u->_data_hash); 17 foreach my $i (qw/name score trader_score_secondary army_score_main ally/) {
16 foreach my $c ($u->cities) { 18 printf("%s: %s\n", $i, $u->get($i));
17 print Dumper($c->_data_hash); 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);
18 } 32 }
19 } 33 }