comparison enemy_scores.pl @ 277:cea21f99e56f

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