<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fmudhour</id>
	<title>Manual:DIL Manual/mudhour - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fmudhour"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/mudhour&amp;action=history"/>
	<updated>2026-11-23T21:05:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/mudhour&amp;diff=3028&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/mudhour&amp;diff=3028&amp;oldid=prev"/>
		<updated>2026-11-14T23:19:34Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= mudhour =&lt;br /&gt;
'''Variable''' (integer, read-only).&lt;br /&gt;
&lt;br /&gt;
 mudhour : integer&lt;br /&gt;
&lt;br /&gt;
The hour of the mud day, 0 to 23: 0 is midnight, 12 noon. A mud hour lasts 5 real minutes.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Day and night (weather.cpp): the sun rises at hour 5, it is day from 6 to 20, the sun sets at 21, and from 22 to 4 it is night. spells.zon's sun spells refuse to work when &amp;lt;code&amp;gt;(mudhour &amp;lt; 5) or (mudhour &amp;gt;= 21)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The calendar (vme.h): an hour is 5 real minutes (&amp;lt;code&amp;gt;SECS_PER_MUD_HOUR&amp;lt;/code&amp;gt;), a day 24 hours (2 real hours), a month 14 days (&amp;lt;code&amp;gt;MUD_MONTH&amp;lt;/code&amp;gt;; the comment beside it in vme.h still says 21), a year 9 months (&amp;lt;code&amp;gt;MUD_YEAR&amp;lt;/code&amp;gt;, 10.5 real days). The count starts on 11 August 1990.&lt;br /&gt;
* The mud clock is the real clock at boot plus the game ticks since (&amp;lt;code&amp;gt;mud_date&amp;lt;/code&amp;gt; in weather.cpp). Normally it keeps pace with real time; with &amp;lt;code&amp;gt;vme -w&amp;lt;/code&amp;gt;, or after a god's &amp;lt;code&amp;gt;wtimewarp&amp;lt;/code&amp;gt;, it runs ahead, so code that waits for a time of day can be tried quickly.&lt;br /&gt;
* Written without brackets: &amp;lt;code&amp;gt;mudhour()&amp;lt;/code&amp;gt; doesn't compile. It can't be assigned.&lt;br /&gt;
* An NPC that waits for an hour should wait with a heartbeat shorter than a mud hour and check &amp;lt;code&amp;gt;mudhour&amp;lt;/code&amp;gt; at each tick, as midgaard.zon does with &amp;lt;code&amp;gt;heartbeat := WAIT_SEC*SECS_PER_MUD_HOUR/2;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;while ((mudhour != 6) and (mudhour != 18)) pause;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer in_hours(from : integer, until : integer);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (from &amp;lt; until)&lt;br /&gt;
      return ((mudhour &amp;gt;= from) and (mudhour &amp;lt; until));&lt;br /&gt;
   return ((mudhour &amp;gt;= from) or (mudhour &amp;lt; until));&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells whether the hour is in [from, until); hours wrap round, so &amp;lt;code&amp;gt;in_hours(20, 6)&amp;lt;/code&amp;gt; is the night. It is quests.zon's inHours.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/mudday|mudday]]&lt;br /&gt;
* [[Manual:DIL Manual/mudmonth|mudmonth]]&lt;br /&gt;
* [[Manual:DIL Manual/mudyear|mudyear]]&lt;br /&gt;
* [[Manual:DIL Manual/realtime|realtime]]&lt;br /&gt;
* [[Manual:DIL Manual/heartbeat|heartbeat]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>