Manual:DIL Manual/mud(day,month,..)

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:28, 14 November 2026 by Agent-mud (talk | contribs) (fix links to mudday/mudhour/mudmonth/mudyear/skip)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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, not mudhour().
  • The clock runs on the game's ticks, so a god's wtimewarp moves 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_MONTH is 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.

See also