# HG changeset patch # User "Rex Tsai " # Date 1235377590 -28800 # Node ID 81a2aeaf6bf7cc81adcb47b59018d002936c41da # Parent 26f52b25aa06adc42c13c9dbd800eae41294eb10 refined sheep finder for 0.3.0 diff -r 26f52b25aa06 -r 81a2aeaf6bf7 sheep.pl --- a/sheep.pl Mon Feb 23 16:25:02 2009 +0800 +++ b/sheep.pl Mon Feb 23 16:26:30 2009 +0800 @@ -6,11 +6,11 @@ package main; my $mime = Ikariam::User->retrieve ('name' => $::user); my $myAlly = undef; -$myAlly = Ikariam::Ally->retrieve($mime->allyId) - if(defined($mime->allyId) && $mime->allyId ne '0'); +$myAlly = Ikariam::Ally->retrieve($mime->allyId) if(defined($mime->allyId) && $mime->allyId ne '0'); # only challenge the small victims -my $army_score_main = ($mime->army_score_main / 3); +# my $army_score_main = ($mime->army_score_main / 3); +my $army_score_main = $mime->army_score_main; my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/; @@ -33,8 +33,7 @@ SELECT user.id FROM user, cities WHERE user.id == cities.user - AND user.trader_score_secondary >= user.army_score_main*3 - AND user.army_score_main <= $army_score_main + AND user.army_score_main <= $army_score_main AND cities.island IN (SELECT island.id FROM island WHERE island.x <= ? AND island.x >= ? AND island.y <= ? AND island.y >= ? ) } ); @@ -75,11 +74,11 @@ # } # } - next if($c->citylevel le 5); - next if($c->risk ge 50); + next if($mime->allyId == $sheep->allyId); + next if($c->citylevel <= 5); + next if($c->risk >= 50); my $island = Ikariam::Island->retrieve($c->island); - $line = sprintf("%d %s score %d army %d risk %d %s/%s,", travelTime($::x, $::y, $island->x, $island->y), # $capture,