$capacitystring => '';
$lossperleague => '';
$capitalstring => '';
+$minprofitstring => '';
$distance => '';
$prselector
$someresults
my @warningfs;
my @islandids;
+my $destspec;
+
my $maxmaxdist=35;
my $maxcpu=90;
my $concur_lim=5;
islandids_r => \@islandids, archipelagoes_r => undef
&>
+% my $searchtype= $ARGS{RouteSearchType};
+% if ($searchtype == 0) {
+% $destspec= 'any';
+% } elsif ($searchtype == 1) {
+% $destspec= 'circ';
+% } elsif ($searchtype == 2) {
+
+Destination (one island only):
+<& qtextstring, qa => $qa, dbh => $dbh, emsgstore => \$emsg,
+ thingstring => 'deststring',
+ prefix => 'ds', boxopts => 'size=40',
+ onresults => sub {
+print STDERR "ONRESULTS @_\n";
+ return unless @_;
+ my ($canonname, $island, $arch) = @{ $_[0] };
+ die unless defined $island;
+ $destspec= $island;
+ }
+ &>
+
+% } else {
+% die "$destspec ?";
+% }
+
<&| enter_advrouteopts, qa=>$qa, dbh=>$dbh, routeparams=>$routeparams &>
<td>
<td>
Maximum distance:
- <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ml',
- thingstring => 'distance', emsgstore => \$emsg,
- onresults => sub { ($maxdist)= @_; } &>
- size=10
- </&>
+ <& qtextstring, qa => $qa, dbh => $dbh, prefix => 'ml',
+ thingstring => 'distance', emsgstore => \$emsg, boxopts => 'size=10',
+ onresults => sub { ($maxdist)= @_; }
+ &>
</&>
<input type=submit name=submit value="Search">
-% my $ours= sub { $_[0] =~ m/^lossperleague|^islandstring|^capitalstring|^capacitystring|^distance/; };
+% my $ours= sub { $_[0] =~ m/^lossperleague|^islandstring|^capitalstring|^capacitystring|^minprofitstring|^distance/; };
<& "lookup:formhidden", ours => $ours &>
% }
unless $emsgokorprint->($emsg)
and @islandids
and $allargs->{'submit'}
+ and defined $destspec
and (defined $routeparams->{MaxMass} or
defined $routeparams->{MaxVolume});
}
push @rsargs, defined $routeparams->{LossPerLeaguePct}
? $routeparams->{LossPerLeaguePct}*0.01 : 1e-9;
-push @rsargs, '0';
+push @rsargs, 0; #$routeparams->{MinProfit};
push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea;
-push @rsargs, $ARGS{RouteSearchType} ? 'circ' : 'any';
+push @rsargs, $destspec;
push @rsargs, @islandids;
m/[^-.0-9a-zA-Z]/ and die "$_ $& ?" foreach @rsargs;
<p>
If you submitted several searches and gave up on them (eg by hitting
-`back' or `stop' in your browser), be aware that that doesn't
+"back" or "stop" in your browser), be aware that that doesn't
generally stop the search process at the server end. So it's best to
avoid asking for large searches that you're not sure about.
<h2>Notes</h2>
Per league values count each island visited as one
-(additional) league; the `Dist.' column is however the actual distance
+(additional) league; the "Dist." column is however the actual distance
to be sailed. All profit figures are somewhat approximate; get a
complete trading plan for a route for accurate information.