changeset 277:cea21f99e56f

script for morning scores
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 02 Dec 2008 16:40:53 +0800
parents 8355ec8514f9
children b2510d9339d8 b5897d63f44e
files enemy_scores.pl
diffstat 1 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/enemy_scores.pl	Tue Dec 02 16:40:53 2008 +0800
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+use strict;
+use Ikariam;
+use Data::Dumper;
+use YAML qw/LoadFile/;
+use POSIX qw(strftime);
+
+package main;
+my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/;
+my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/;
+
+package main;
+
+if($#ARGV != 0) {
+    die("Usage: $0 nickname\n");
+}
+
+my ($u) = Ikariam::User->search('name' => $ARGV[0]);
+if(defined($u)) {
+    foreach my $i (qw/name time score trader_score_secondary army_score_main ally/) {
+        if($i eq "time") {
+            printf("time: %s, ",  strftime ("%Y-%m-%d %H:%M", localtime($u->get('time'))));
+        } else {
+            printf("%s: %s, ", $i, $u->get($i));
+        }
+    }
+    print("\n");
+}