The script below is a kludge, but it seems to work. It was written fairly quickly and given minimal testing.
Additions to the script should include a relog in the event you drop connection with your server that would relog into the admin screen.
Code:
# t-editOpenGames.ts
# automatically open closed games
# Log into through Admin mode and run
# a kludge of a script by Promethius
setVar $games "Not Set"
setVar $time "Not Set"
:menu
echo ANSI_11 "**(1) Enter the game(s) to be opened. " ANSI_15 $games
echo ANSI_11 "*(2) Enter the time to be opened. " ANSI_15 $time
echo ANSI_13 "*(S) Start script"
echo ANSI_12 "*(Q) Abort script*"
getConsoleInput $menuChoice singlekey
lowercase $menuChoice
if ($menuChoice = 1)
setVar $games ""
setVar $i 1
setVar $cnt 1
while ($i <> 0)
echo ansi_12 "*Enter Game Letter for game " ANSI_15 $cnt ANSI_12 " to open or" ansi_9 " 0 " ANSI_12 "to finish"
getConsoleInput $i singlekey
add $cnt 1
if ($i <> 0)
setVar $games $games & $i & " "
else
goto :menu
end
end
elseif ($menuChoice = 2)
echo "*Enter the hour to open the game and press enter"
getConsoleInput $hour
echo "*Enter the minutes to open the game in mm (00, 30)"
getConsoleInput $minutes
echo "*Enter is this AM or PM (a/p)?"
getConsoleInput $amPM singlekey
setVar $time $hour & ":" & $minutes & " " & $amPM
elseif ($menuChoice = "s") and ($time <> "Not Set") and ($games <> "Not Set")
goto :begin
elseif ($menuChoice = "q")
halt
end
goto :menu
:begin
gettime $now "h mm a/p"
getword $now $nowHour 1
getword $now $nowMin 2
getWord $now $nowAP 3
if ($nowhour = $hour) and ($nowMin >= $minutes) and ($nowAP = $amPM)
goto :opengames
else
setDelayTrigger delay :myDelay 10000
pause
:myDelay
send "?"
goto :begin
end
:opengames
killtrigger myDelay
setVar $arrayCnt 1
getword $games $gameLetter $arrayCnt
while ($gameLetter <> 0)
send $gameLetter
setTextTrigger inEdit :inEdit "Trade Wars 2002 Editor"
pause
:inEdit
send "h"
waitfor "General Editor Two"
send "["
waitfor "Should this be a"
send "n"
waitfor "General Editor Two"
send "q"
waitfor "Trade Wars 2002 Editor"
send "q"
setTextTrigger adminMenu :adminMenu "Selection (?"
pause
:adminMenu
add $arrayCnt 1
getWord $games $gameLetter $arrayCnt
end
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."