Manual:DIL Manual/mud(day,month,..)
Jump to navigation
Jump to search
mudhour, mudday, mudmonth, mudyear
Variables (integer, read only).
mudhour : integer mudday : integer mudmonth : integer mudyear : integer
The game's clock and calendar. Each has its own page; this page shows them together.
| Variable | Range | Length |
|---|---|---|
| mudhour | 0 to 23 | one mud hour is 5 real minutes (SECS_PER_MUD_HOUR)
|
| mudday | 0 to 13: the day of the month | one mud day is 24 mud hours, 2 real hours |
| mudmonth | 0 to 8 | a month is 14 days (MUD_MONTH)
|
| mudyear | 0 and up | a year is 9 months (MUD_YEAR)
|
Notes
- They are variables, not functions: write
mudhour, notmudhour(). - The clock runs on the game's ticks, so a god's
wtimewarpmoves it forward too. - The constants are in vme.h. The comments there that say "21 mud days per mud month" are out of date:
MUD_MONTHis 14.
Example
dilbegin nightwatch();
code
{
heartbeat := PULSE_SEC * 60;
:start:
wait(SFB_TICK, (mudhour >= 22) or (mudhour < 6));
exec("emote lights a lantern.", self);
wait(SFB_TICK, (mudhour >= 6) and (mudhour < 22));
exec("emote puts out the lantern.", self);
goto start;
}
dilend
A watchman who lights his lantern at night.