One of the problems of custom Intro.ans files is if you show dates when your games open, you have to remember to change them and then do it when banging a new game. The following script will update your Intro.ANS file.
Precautions: Back up your original intro.ans file as the script has to read and then delete the file before rewriting it.
You have to be on the server for this to run. It is a simple script that can, and should, be modified to do multiple game date replacements. Please note that you should have to have unique game names for each game or it will replace dates for multiple games that originally opened on the same date. Game name and previous date opened must equal what you enter for a line to be updated.
# update Intro.ANS game date
# change the path below to match your setup!!!
setVar $intro "c:\program files\epic interactive strategy\twgs\intro.ans"
fileExists $exists $intro
if ($exists = FALSE)
clientMessage "Please check the path, File Not Found at:"
clientMessage $intro
halt
end
setVar $i 1
read $intro $line $i
while ($line <> EOF)
# display menu with clientMessage - will not display exact
clientMessage $line
setVar $fileLine[$i] $line
add $i 1
read $intro $line $i
end
subtract $i 1
echo ansi_12 "*Enter the edit name to update the date for*"
getConsoleInput $ansiGame
echo ANSI_12 "*Enter previous game start date*"
getConsoleInput $ansiPreviousDate
echo ansi_12 "*Enter new game start date*"
getConsoleInput $ansiNewDate
setVar $iWrite 1
delete $intro
while ($iWrite <= $i)
getWordPos $fileLine[$iWrite] $posName $ansiGame
getWordPos $fileLine[$iWrite] $posDate $ansiPreviousDate
if ($posName > 0) and ($posDate > 0)
replaceText $fileLine[$iWrite] $ansiPreviousDate $ansiNewDate
end
write $intro $fileLine[$iWrite]
add $iWrite 1
end
echo ANSI_14 "**Update complete.**"
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."