comparison freeland.pl @ 181:dba0543daf36

now, you can assign tradegood for search freeland
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 02 Nov 2008 16:52:40 +0800
parents 73f0a1cafc23
children a9847bf80058
comparison
equal deleted inserted replaced
174:0cfc7a19a4d2 181:dba0543daf36
5 5
6 package main; 6 package main;
7 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/; 7 my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/;
8 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/; 8 my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/;
9 9
10 if($#ARGV != 1) { 10 if($#ARGV != 2) {
11 die("Usage: $0 x y\n"); 11 die("Usage: $0 x y tradegood (1 葡萄酒, 2 大理石, 3 水晶, 4 硫磺/)\n");
12 } 12 }
13 my ($x, $y) = @ARGV; 13 my ($x, $y, $tradegood) = @ARGV;
14 14
15 my @location = (($x + 6), ($x - 6), ($y + 6), ($y - 6)); 15 my @location = (($x + 6), ($x - 6), ($y + 6), ($y - 6));
16 16
17 # 找空位 17 # 找空位
18 Ikariam::Cities->set_sql(lamers => qq { 18 Ikariam::Cities->set_sql(lamers => qq {
25 } 25 }
26 ); 26 );
27 27
28 # 28 #
29 my @islands = Ikariam::Island->retrieve_from_sql(qq{ 29 my @islands = Ikariam::Island->retrieve_from_sql(qq{
30 tradegood == 2 30 tradegood == $tradegood
31 AND people < 16 31 AND people < 16
32 AND x <= $location[0] 32 AND x <= $location[0]
33 AND x >= $location[1] 33 AND x >= $location[1]
34 AND y <= $location[2] 34 AND y <= $location[2]
35 AND y >= $location[3] 35 AND y >= $location[3]