View unanswered posts | View active topics It is currently Thu Jan 01, 2026 6:12 pm



Reply to topic  [ 2 posts ] 
 qPlot include - Plots CF w/o triggers 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post 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."


Sun Oct 23, 2011 5:13 pm
Profile ICQ
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: qPlot include - Plots CF w/o triggers
... and if you prefer interrogation mode, it is the same script with one line change:

Code:
:qPlotInt
  setVar $hops 1
  setVar $line ""
  send "^f" $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

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."


Sun Oct 23, 2011 6:47 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 195 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.