Difference between revisions of "Manual:DIL Manual/mud(day,month,..)"
Jump to navigation
Jump to search
(XML import) |
(fix links to mudday/mudhour/mudmonth/mudyear/skip) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | = 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. | |
| − | + | ||
| − | + | {| class="wikitable" | |
| − | + | ! 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/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/mudyear|mudyear]] || 0 and up || a year is 9 months (<code>MUD_YEAR</code>) | ||
| + | |} | ||
| + | |||
| + | == Notes == | ||
| + | * They are variables, not functions: write <code>mudhour</code>, not <code>mudhour()</code>. | ||
| + | * The clock runs on the game's ticks, so a god's <code>wtimewarp</code> 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: <code>MUD_MONTH</code> is 14. | ||
| + | |||
| + | == Example == | ||
| + | <pre> | ||
| + | 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 | ||
| + | </pre> | ||
| + | A watchman who lights his lantern at night. | ||
| + | |||
| + | == See also == | ||
| + | * [[Manual:DIL Manual/mudhour|mudhour]] | ||
| + | * [[Manual:DIL Manual/mudday|mudday]] | ||
| + | * [[Manual:DIL Manual/mudmonth|mudmonth]] | ||
| + | * [[Manual:DIL Manual/mudyear|mudyear]] | ||
| + | * [[Manual:DIL Manual/realtime|realtime]] | ||
| + | * [[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, 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.