comparison sheep.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 e68f4cadfabd
children 552528bb4917
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 葡萄酒 大理石 水晶 硫磺/;
7 8
8 Ikariam::User->has_many(cities => 'Ikariam::Cities'); 9 Ikariam::User->has_many(cities => 'Ikariam::Cities');
9 Ikariam::User->set_sql(inactivity => qq { 10 Ikariam::User->set_sql(inactivity => qq {
10 SELECT user.id 11 SELECT user.id
11 FROM user, cities, island 12 FROM user, cities, island
67 68
68 printf("%d %s %d,%d,%s of %s (%d),", 69 printf("%d %s %d,%d,%s of %s (%d),",
69 $sheep->trader_score_secondary, $c->status, $sheep->score, $sheep->army_score_main, $sheep->name, $sheep->ally, $members); 70 $sheep->trader_score_secondary, $c->status, $sheep->score, $sheep->army_score_main, $sheep->name, $sheep->ally, $members);
70 71
71 my $island = Ikariam::Island->retrieve($c->island); 72 my $island = Ikariam::Island->retrieve($c->island);
72 printf("%s,%d,[%d,%d],http://s2.ikariam.tw/index.php?view=island&id=%d\n", $c->cityname, $c->citylevel, 73 printf("%s %d [%d,%d] %s http://s2.ikariam.tw/index.php?view=island&id=%d\n", $c->cityname, $c->citylevel,
73 $island->x, $island->y, 74 $island->x, $island->y,
75 $tradegoodText[$island->tradegood],
74 $island->id); 76 $island->id);
75 } 77 }
76 printf("\n"); 78 printf("\n");
77 } 79 }
78 } 80 }