Here are the changes I made to STD.T to display the time and day of the week
on the status line instead of "score/moves". Feel free to use these this code
in your games or modify it as you see fit. Enjoy!
Add the following to the "init" function:
init: function
{
scoreStatus(global.hours, global.minutes);
setdaemon( timeDaemon, nil ); // start the clock daemon
}
Add the following to the "global" object:
global: object
hours = 9 // set the time to Saturday at 9:00 PM
minutes = 0
PMtime = true // true if PM, nil if AM
DayNum = 7 // 1 = Sunday, 2= Monday, etc.
DayofWeek = ' / Saturday' // set the initial day of the week
;
replace undoVerb: sysverb
verb = 'undo'
action(actor) =
{
/* do TWO undo's - one for this 'undo', one for previous command */
if (undo() and undo())
{
"(Undoing one command)\b";
Me.location.lookAround(true);
scoreStatus(global.hours, global.minutes);
}
else
"No more undo information is available. ";
abort;
}
;
replace restoreVerb: sysverb
verb = 'restore'
sdesc = "restore"
doAction = 'Restore'
action( actor ) =
{
local savefile;
savefile := askfile( 'File to restore game from' );
if ( savefile = nil or savefile = '' )
"Failed. ";
else if (restore( savefile ))
"Restore failed. ";
else
{
scoreStatus(global.hours, global.minutes);
"Restored.\b";
Me.location.lookAround(true);
}
abort;
}
;
Well, that's all there is to it. Please let me know if there is anything I
missed or if there are any bugs. I can be reached here or on GEnie at my
e-mail address of J.MENICHELLI.