View unanswered posts | View active topics It is currently Tue Apr 21, 2026 6:11 pm



Reply to topic  [ 1 post ] 
 SysOp Intro.ANS Update 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post SysOp Intro.ANS Update
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."


Sun Oct 26, 2008 4:34 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.