xboxscene.org forums

Author Topic: New Date Auto-advance Script  (Read 156 times)

firefoxf7

  • Archived User
  • Newbie
  • *
  • Posts: 7
New Date Auto-advance Script
« on: June 08, 2004, 01:00:00 PM »

I have spent a while looking for a dash that will cause my clock to autoadvance between powerups (I dont mind if the date is wrong - I just want save games to be in the right order).  After discovering MXM action scripts I wrote the following script which, when called from autoexec, does just that...

OPENREAD listFile date.txt
READFILELN listFile fileline
Set date %fileline%
READFILELN listFile fileline
Set month %fileline%
READFILELN listFile fileline
Set year %fileline%
CLOSEFILE listFile
Add date 1

IF# %date% > 28 GOTO NEWMONTH

:CHECKMONTH
IF# %month% > 12 GOTO NEWYEAR

:SETDATE
OPENWrite listFile date.txt
WRITEFILELN listFile %date%
WRITEFILELN listFile %month%
WRITEFILELN listFile %year%
CLOSEFILE listFile
Date %date% %month% %year%
GOTO DATEDONE

:NEWMONTH
Add month 1
SET date 1
GOTO CHECKMONTH

:NEWYEAR
Add year 1
SET month 1
GOTO SETDATE

:DATEDONE


It relies on a file called date.txt with the day, month and year on seperate lines, and increments the date between powerups by 1 day.  It is very rough, assuming that all months have 28 days, and falling over if the date file is not there, but it works and is good enough for me.  However, if anyone is interested I will improve it and tidy it up to make it work a bit better.  Anyone interested?
Logged