<?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%2Fmudday</id>
	<title>Manual:DIL Manual/mudday - 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%2Fmudday"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/mudday&amp;action=history"/>
	<updated>2026-11-23T20:46:14Z</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/mudday&amp;diff=3027&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/mudday&amp;diff=3027&amp;oldid=prev"/>
		<updated>2026-11-14T23:19:31Z</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;= mudday =&lt;br /&gt;
'''Variable''' (integer, read-only).&lt;br /&gt;
&lt;br /&gt;
 mudday : integer&lt;br /&gt;
&lt;br /&gt;
The day of the mud month, 0 to 13. A mud day lasts 2 real hours; mudday changes at midnight (mudhour 0).&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The &amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; command (commands.zon) shows &amp;lt;code&amp;gt;mudday + 1&amp;lt;/code&amp;gt; as the day of the month, and takes the day of the week from &amp;lt;code&amp;gt;mudday % 7&amp;lt;/code&amp;gt;.&lt;br /&gt;
* For &amp;quot;once a day&amp;quot;, keep the last day seen and compare, as the shops in function.zon do to restock (&amp;lt;code&amp;gt;if (mudday != prev_mudday)&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;mudday()&amp;lt;/code&amp;gt; doesn't compile. It can't be assigned.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin daily_stock(sym : string);&lt;br /&gt;
var&lt;br /&gt;
   lastday : integer;&lt;br /&gt;
   u       : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   heartbeat := PULSE_SEC * 60;&lt;br /&gt;
   lastday := mudday;&lt;br /&gt;
&lt;br /&gt;
   :start:&lt;br /&gt;
   wait(SFB_TICK, TRUE);&lt;br /&gt;
   if (mudday == lastday)&lt;br /&gt;
      goto start;&lt;br /&gt;
   lastday := mudday;&lt;br /&gt;
   u := findsymbolic(self, sym, FIND_UNIT_INVEN);&lt;br /&gt;
   if (u == null)&lt;br /&gt;
   {&lt;br /&gt;
      u := load(sym);&lt;br /&gt;
      exec(&amp;quot;emote unpacks a fresh crate.&amp;quot;, self);&lt;br /&gt;
   }&lt;br /&gt;
   goto start;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A shopkeeper (&amp;lt;code&amp;gt;dilcopy daily_stock@zone(&amp;quot;bread@zone&amp;quot;);&amp;lt;/code&amp;gt;) that once a mud day loads a new item of a kind when it has none left.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/mudhour|mudhour]]&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;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>