annotate enemy_scores.pl @ 377:5d6f429e5f19 tip

fixed a typo.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 14 Apr 2009 17:16:43 +0800
parents e551351b18de
children
rev   line source
277
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
1 #!/usr/bin/perl
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
2 use strict;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
3 use Ikariam;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
4 use Data::Dumper;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
5 use YAML qw/LoadFile/;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
6 use POSIX qw(strftime);
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
7
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
8 package main;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
9 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
10 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
11
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
12 package main;
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
13
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
14 if($#ARGV != 0) {
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
15 die("Usage: $0 nickname\n");
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
16 }
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
17
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
18 my ($u) = Ikariam::User->search('name' => $ARGV[0]);
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
19 if(defined($u)) {
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
20 foreach my $i (qw/name time score trader_score_secondary army_score_main ally/) {
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
21 if($i eq "time") {
374
e551351b18de updated for timestamp of scores information
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents: 277
diff changeset
22 if(defined($u->get('time'))) {
e551351b18de updated for timestamp of scores information
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents: 277
diff changeset
23 printf("time: %s, ", strftime ("%Y-%m-%d %H:%M", localtime($u->get('time'))));
e551351b18de updated for timestamp of scores information
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents: 277
diff changeset
24 } else {
e551351b18de updated for timestamp of scores information
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents: 277
diff changeset
25 printf("time: %s, ", strftime ("%Y-%m-%d %H:%M", localtime()));
e551351b18de updated for timestamp of scores information
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents: 277
diff changeset
26 }
277
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
27 } else {
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
28 printf("%s: %s, ", $i, $u->get($i));
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
29 }
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
30 }
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
31 print("\n");
cea21f99e56f script for morning scores
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
32 }