comparison enemy.pl @ 274:2590bcd517a5

added time information in output
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 01 Dec 2008 20:54:23 +0800
parents f81c4f9d267f
children 2ddd2bd21ef2
comparison
equal deleted inserted replaced
273:f81c4f9d267f 274:2590bcd517a5
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 use strict; 2 use strict;
3 use Ikariam; 3 use Ikariam;
4 use Data::Dumper; 4 use Data::Dumper;
5 use YAML qw/LoadFile/; 5 use YAML qw/LoadFile/;
6 use POSIX qw(strftime);
6 7
7 package main; 8 package main;
8 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/; 9 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/;
9 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/; 10 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/;
10 11
94 my ($u) = Ikariam::User->search('name' => $ARGV[0]); 95 my ($u) = Ikariam::User->search('name' => $ARGV[0]);
95 if(defined($u)) { 96 if(defined($u)) {
96 foreach my $i (qw/name score trader_score_secondary army_score_main ally/) { 97 foreach my $i (qw/name score trader_score_secondary army_score_main ally/) {
97 printf("%s: %s\n", $i, $u->get($i)); 98 printf("%s: %s\n", $i, $u->get($i));
98 } 99 }
100 printf("time: %s\n", strftime ("%Y-%m-%d %H:%M", localtime($u->get('time'))));
99 101
100 travelMatrix($ARGV[0]); 102 travelMatrix($ARGV[0]);
101 103
102 printf("\nCities\n"); 104 printf("\nCities\n");
103 foreach my $city ($u->cities) { 105 foreach my $city ($u->cities) {