Are you familiar with the triggering technique I've preached on before? I think of it as trigger-driven script flow. It's not the best technique under all circumstances, but I believe it's ideal for something like this. What is unique about this technique is that there is no main routine where script flow keeps returning to, for triggers to be killed and reset. Rather, triggers fire and reset themselves, so management is decentralized, kinda like an Object Oriented approach vs. linear flow.
Code:
:holoScan
send "sh"
waitOn "Long Range Scan"
setTextLineTrigger hsSector :hsSector "Sector : "
setTextLineTrigger hsPorts :hsPorts "Ports :"
setTextLineTrigger hsPlanets :hsPlanets "Planets :"
setTextLineTrigger hsTraders :hsTraders "Traders :"
setTextLineTrigger hsFighters :hsFighters "Fighters:"
setTextTrigger hsDone :hsDone "Command ["
pause
:hsSector
getWord CURRENTLINE $sector 3
setTextLineTrigger hsSector :hsSector "Sector : "
pause
:hsPorts
getText CURRENTLINE $portType "(" ")"
setVar $sectorInfo[$sector][1] $portType
setTextLineTrigger hsPorts :hsPorts "Ports :"
pause
:hsPlanets
setVar $sectorInfo[$sector][2] "Planet"
setTextLineTrigger hsPlanets :hsPlanets "Planets :"
pause
:hsTraders
cutText CURRENTLINE $sectorInfo[$sector][3] 10 999
setTextLineTrigger hsTraders :hsTraders "Traders :"
pause
:hsFighters
getwordpos CURRENTLINE $pos "belong to your Corp"
if ($pos = 0)
getWord CURRENTLINE $sectorInfo[$sector][4] 2
end
setTextLineTrigger hsFighters :hsFighters "Fighters:"
pause
:hsDone
killTrigger hsSector
killTrigger hsPorts
killTrigger hsPlanets
killTrigger hsTraders
killTrigger hsFigs
# script continues here
Years ago, I saw a script by a corp called Defenders of the Universe, and they had a script that used a rudimentary version of this technique. At that time, I couldn't understand how it was even working, as it was unlike anything I'd seen. It took me a while to understand it, because everything else I'd seen followed a basic pattern of: set all triggers, pause, fire and parse, killAlllTriggers, go back to set all triggers.
To anyone reading this thread that doesn't understand the above code, do yourself a favor and ask questions and figure it out. If nothing else, you'll walk away with a much better understanding of how triggers work.
+EP+