Difference between revisions of "Manual:DIL Manual/mud(day,month,..)"

From DikuMUD Wiki
Jump to navigation Jump to search
(checked against the compiler and the interpreter; example compiles)
(fix links to mudday/mudhour/mudmonth/mudyear/skip)
 
Line 12: Line 12:
 
! Variable !! Range !! Length
 
! Variable !! Range !! Length
 
|-
 
|-
−
| [[Manual:DIL Manual/mudhour()|mudhour]] || 0 to 23 || one mud hour is 5 real minutes (<code>SECS_PER_MUD_HOUR</code>)
+
| [[Manual:DIL Manual/mudhour|mudhour]] || 0 to 23 || one mud hour is 5 real minutes (<code>SECS_PER_MUD_HOUR</code>)
 
|-
 
|-
−
| [[Manual:DIL Manual/mudday()|mudday]] || 0 to 13: the day of the month || one mud day is 24 mud hours, 2 real hours
+
| [[Manual:DIL Manual/mudday|mudday]] || 0 to 13: the day of the month || one mud day is 24 mud hours, 2 real hours
 
|-
 
|-
−
| [[Manual:DIL Manual/mudmonth()|mudmonth]] || 0 to 8 || a month is 14 days (<code>MUD_MONTH</code>)
+
| [[Manual:DIL Manual/mudmonth|mudmonth]] || 0 to 8 || a month is 14 days (<code>MUD_MONTH</code>)
 
|-
 
|-
−
| [[Manual:DIL Manual/mudyear()|mudyear]] || 0 and up || a year is 9 months (<code>MUD_YEAR</code>)
+
| [[Manual:DIL Manual/mudyear|mudyear]] || 0 and up || a year is 9 months (<code>MUD_YEAR</code>)
 
|}
 
|}
  
Line 47: Line 47:
  
 
== See also ==
 
== See also ==
−
* [[Manual:DIL Manual/mudhour()|mudhour]]
+
* [[Manual:DIL Manual/mudhour|mudhour]]
−
* [[Manual:DIL Manual/mudday()|mudday]]
+
* [[Manual:DIL Manual/mudday|mudday]]
−
* [[Manual:DIL Manual/mudmonth()|mudmonth]]
+
* [[Manual:DIL Manual/mudmonth|mudmonth]]
−
* [[Manual:DIL Manual/mudyear()|mudyear]]
+
* [[Manual:DIL Manual/mudyear|mudyear]]
 
* [[Manual:DIL Manual/realtime|realtime]]
 
* [[Manual:DIL Manual/realtime|realtime]]
 
* [[Manual:DIL Manual/weather|weather]]
 
* [[Manual:DIL Manual/weather|weather]]

Latest revision as of 23:28, 14 November 2026

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