
Script List / Select by Number
A simple script to list .ts and .cts scripts and then select by number. Modify to meet your needs.
setVar $version "Script List .1"
getFileList $scriptsTS ".\scripts\*" & ".*ts"
setVar $i 1
setVar $scriptCnt 1
setVar $window ""
Window ZTM 475 375 " " & $version & " by Promethius " ONTOP
while ($i <= $scriptsTS)
setVar $window $window & "[" & $i & "] " & $scriptsTS[$i] & "*"
if ($scriptCnt = 20) or ($i= $scriptsTS)
setWindowContents ZTM $window & "*Press ~ to Continue or = to select*"
setTextOutTrigger continue :continue "~"
setTextOutTrigger select :select "="
pause
:select
echo ANSI_13 "*Enter number of script to run"
getConsoleInput $scriptNumber
load $scriptsTS[$scriptNumber]
halt
:continue
killtrigger select
setVar $window ""
setVar $scriptCnt 0
end
add $scriptCnt 1
add $i 1
end
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."