/* REXX */ /* Open the data file */ CALL STREAM "FINDER.DAT", "C", "OPEN WRITE" jump="" start="" /* Get the distance from Terra of the target sector */ CALL ZocWriteln CALL ZocWriteln "This will find all x deep tunnels" CALL ZocWriteln "Results can be found in the file FINDER.DAT" CALL ZocWriteln CALL ZocWriteln "How many sectors do you wish to have in the tunnel? -=> " PULL jump /* This seems superfluous. Should always start at sector 11 */ CALL ZocWriteln CALL ZocWriteln "Enter the sector to start search at (greater than 2) -=> " PULL start a=start CALL ZOCsend("c") /* This script only works for a 5000 sector Universe */ DO until a > 1212 hops="" /* Display a path from Terra to the Current Sector */ CALL Zocsend("f1^M") CALL Zocsend(a) CALL Zocsend("^M") CALL ZOCwait("is:") /* Extract the number of hops */ /* It is assumed that the number of hops is less than 100 */ cl=ZOClastline() hops=substr(cl,20,2) /* Trim a trailing space if necessary */ if substr(hops,2,1)=" " then do hops=substr(hops,1,1) end /* If the number of hops is equal to the target value, write a line to the data file */ void=hops-deep b=1 DO until b > void call zocwait ">" end call zocwait ">" secvoid=ZOClastline() Call zocwriteln "Writing to data file" CALL lineout "finder.dat",secvoid a=a+1 END CALL STREAM "FINDER.DAT", "C", "CLOSE"