This script was contributed by Sargas. The real stand-out feature on this one (to my mind, anyway) is the enter-completion, which lets you get away with partial names. Since I use my own speedwalker, I haven't tried this one. (This means you'll have to ask Sargas for support)


;; sw.tf - nice little speedwalk script featuring a kind of half-assed
;;         tab-complete ( uses enter ) but you don't have to remember 
;;         long names. replaces ';'s in speedwalks with '%;'s so you dont
;;         have too.
;;
;; 02/2002 - first incarnation - lucas
;; 07/2002 - finaly get around to fixing /run to do enter-complete
;;         - add 0-9- to speedwalk names

;; setup - place sw.tf and the speedwalk file of our choice into ~/mud
;;         ( assuming you start tf from your home dir ).  From tf issue
;;         '/load mud/sw.tf' and '/loadruns' and you should be set. 

;; read speedwalks from file into two vars, one for speedwalk, one for name
;;  useage /loadruns path/to/sw.txt or without a name points to mud/sw.txt
/def loadruns=/if ( {1} =~ "" ) \
 /loadruns mud/sw.txt%;\
 /else \
  /let a=$[ tfopen( {1}, "r" ) ]%;\
  /if ( a != -1 ) \
   /set swcount=0%;\
   /while ( tfread( a, _runtmp ) != -1 ) \
    /if ( regmatch( "^([a-z0-9_-]+) (.*)$", _runtmp ))\
     /set _run_%swcount=%P2%;\
     /set _runnames_%swcount=%P1%;\
     /set swcount=$[swcount+1]%;\
    /endif%;\
   /done%;\
   /test tfclose( a )%;\
  /endif%;\
    /echo ==============================%;\
  /echo %swcount Speedwalks Loaded.%;\
    /echo ==============================%;\
 /endif


;; remove all loaded runs
/def purgeruns=/quote -S /unset `/listvar -s _run*

;; return name or run given number
/def getname = /return _runnames_%1


;; if the user entered a valid name, run there, else show a
;;  list of partial matches
/def run = \
 /if ( {1} !~ '' ) \
  /let _rc=0%;\
  /let _ri=0%;\
  /let _tmp_run=-1%;\
  /while ( _ri < swcount ) \
   /if ( {1} =~ getname( _ri ) ) \
    /let _tmp_run=$[ _ri ]%;\
    /let _ri=$[ swcount ]%;\
   /elseif ( strncmp( getname( _ri ), {1}, strlen( {1} )  ) == 0  ) \
    /set _tmp_n_%_rc=%_ri%;\
    /let _rc=$[ _rc + 1 ]%;\
   /endif%;\
   /let _ri=$[ _ri + 1 ]%;\
  /done%;\
  /let _ri=0%;\
  /if ( _tmp_run == -1 ) \
   /if ( _rc == 0 ) \
    /echo ==============================%;\
    /echo 0 matches found...%;\
    /echo ==============================%;\
   /elseif ( _rc == 1 ) \
    /input /run $[getname( _tmp_n_0 )]%;\
   /else \
    /echo ==============================%;\
    /echo %_rc matches found...%;\
    /let _ta=0%;\
    /let _tb=0%;\
    /let _tm=256%;\
    /let _ti=$[ strlen( {1} ) ]%;\
    /while ( _ta < _rc ) \
     /test getname( _tmp_n_%_ta )%;\
     /echo %?%;\
;; auto complete part, find longest substring all matches share
     /while ( _tb < _rc ) \
       /test scomp( getname( _tmp_n_%_ta ), getname( _tmp_n_%_tb ), {_ti}  )%;\
       /let _ri=%?%;\
       /if ( _ri < _tm ) \
        /let _tm=%_ri%;\
       /endif%;\
      /let _tb=$[ _tb + 1 ]%;\
     /done%;\
     /let _ta=$[ _ta + 1 ]%;\
    /done%;\
    /echo ==============================%;\
;; rewrite input with match
    /input /run $[ substr( getname( _tmp_n_0 ), 0, _tm ) ]%;\
   /endif%;\
  /else \
;; run away!!!
   /test replace( ";", "\%;", _run_%_tmp_run )%;/eval %?%;\
  /endif%;\
;; clean up non let'd vars
   /while ( _rc >= 0 ) \
    /unset _tmp_n_%_rc%;\
    /let _rc=$[_rc-1]%;\
   /done%;\
 /else \
    /echo ==============================%;\
  /echo  sorry, you need to supply atleast part of a name, I'm%;\
  /echo  not going to list all %swcount speedwalks for you.%;\
    /echo ==============================%;\
 /endif
;; and of course i just think of a nicer way to do this.. to late now

;; return the last position %1 and %2 are equal starting at position %3
/def scomp = \
 /set k=%3%;\
 /while ( strncmp( {1}, {2}, k ) == 0 & k < 255 ) \
  /set k=$[k+1]%;\
 /done%;\
 /return $[k-1]
;; do not remove this line