
qPlot include - Plots CF w/o triggers
To me it is easier than messing with set triggers to get the hops and plots in a course. Credit on the CURRENTANSILINE usage goes to EP from his qStats script challenge.
[Edit] Made it a little more useful and removed code that wasn't necessary.[/Edit]
The shortest path (14 hops, 56 turns) from sector 300 to sector 1500 is:
300 > (12268) > (4044) > (15408) > (11544) > (18471) > (16952) > (14595) >
(4128) > (18898) > (6368) > (12059) > (13421) > (19542) > (1500)
Computer command [TL=00:00:00]:[18491] (?=Help)? Q
<Computer deactivated
300 > 12268 > 4044 > 15408 > 11544 > 18471 > 16952 > 14595 > 4128 > 18898 > 6368
> 12059 > 13421 > 19542 > 1500
Hops: 14
Move to: 12268
Move to: 4044
Move to: 15408
Move to: 11544
Move to: 18471
Move to: 16952
Move to: 14595
Move to: 4128
Move to: 18898
Move to: 6368
Move to: 12059
Move to: 13421
Move to: 19542
Move to: 1500
The script:
# setup test plots
setVar $startPlot 300
setVar $endPlot 1500
:qPlot
setVar $hops 1
setVar $line ""
send "cf" $startPlot "*" $endPlot "*q"
waiton $startPlot & " >"
while (CURRENTANSILINE <> #13)
setVar $line $line & currentline
waitOn ""
end
stripText $line "("
stripText $line ")"
setVar $parseCnt 3
getword $line $moveTo[$hops] $parseCnt
while ($moveTo[$hops] <> 0)
add $parseCnt 2
add $hops 1
getword $line $moveTo[$hops] $parseCnt
end
subtract $hops 1
# display
echo ANSI_12 "**" & $line & "**"
echo ANSI_12 "Hops: " $hops "**"
setVar $i 1
while ($i <= $hops)
echo "* Move to: " $moveto[$i]
add $i 1
end
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."