Hehe. Sure thing...
Code:
# Get the course
:get_course
setVar $sectors ""
# Wait for the course to start
killtrigger timeout
setDelayTrigger timeout :course_timeout 3000
send "^ f *" & $destination & "**q"
waitFor " TO > "
killtrigger timeout
# Start reading the course
killtrigger read_line
killtrigger no_path_1
killtrigger no_path_2
killtrigger no_path_3
setTextLineTrigger read_line :readline " > "
setTextLineTrigger no_path_1 :no_path "So what's the point?"
setTextLineTrigger no_path_2 :no_path ": ENDINTERROG"
setTextLineTrigger no_path_3 :no_path "No route within"
pause
# - - - - - - - - - - - - - - - - - - - - - - - -
# No path...
:no_path
killtrigger read_line
killtrigger no_path_1
killtrigger no_path_2
killtrigger no_path_3
setVar $result "BAD"
return
# - - - - - - - - - - - - - - - - - - - - - - - -
# Got a path
:readline
killtrigger read_line
killtrigger no_path_1
killtrigger no_path_2
killtrigger no_path_3
# Did we get the end line?
getWord CURRENTLINE $endtest 2
if ($endtest = "ENDINTERROG")
goto oneline
end
# Append line
setVar $sectors $sectors & " " & CURRENTLINE
# Reset the trigger
setTextLineTrigger read_line :readline ""
pause
# Done reading lines
oneline
killtrigger read_line
# Clean up the sectors list
striptext $sectors "("
striptext $sectors ")"
replacetext $sectors ">" " "
# - - - - - - - - - - - - - - - - - - - - - - - -
# Create the course array
:create_course_array
setVar $sectors $sectors & " %&%&%"
setVar $course_length 0
setVar $wordy ""
setVar $word_to_read 1
while ($wordy <> "%&%&%")
getWord $sectors $wordy $word_to_read
if ($wordy <> "%&%&%")
add $course_length 1
setVar $course[$course_length] $wordy
end
add $word_to_read 1
end
return
:course_timeout
killtrigger timeout
setVar $result "BAD"
return
Then all you have to do is...
Code:
setVar $destination 1234
gosub :get_course
And it gets the course as a neat little array, taking in account avoids w/o requiring a ztm.
One small example. I make extensive use of subroutines and includes.