<?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%2Fwaitnoop</id>
	<title>Manual:DIL Manual/waitnoop - 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%2Fwaitnoop"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/waitnoop&amp;action=history"/>
	<updated>2026-11-22T23:36:20Z</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/waitnoop&amp;diff=2974&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/waitnoop&amp;diff=2974&amp;oldid=prev"/>
		<updated>2026-11-14T23:15:58Z</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;= waitnoop =&lt;br /&gt;
'''Instruction.''' Steps out of the current event for a moment.&lt;br /&gt;
&lt;br /&gt;
 waitnoop;&lt;br /&gt;
&lt;br /&gt;
The program stops here and runs on almost at once: in the same pass of the game's event queue, after the event that woke it has been dealt with. A follower woken by its master's move (an &amp;lt;code&amp;gt;SFB_DONE&amp;lt;/code&amp;gt; event) uses it so that the master's command finishes, and the other programs get the event, before the follower runs a command of its own with [[Manual:DIL Manual/exec()|exec()]].&lt;br /&gt;
&lt;br /&gt;
It is written without parentheses: &amp;lt;code&amp;gt;waitnoop();&amp;lt;/code&amp;gt; is a syntax error.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Nothing else wakes the program while it waits: no commands, messages or ticks, and no &amp;lt;code&amp;gt;interrupt()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;on_activation()&amp;lt;/code&amp;gt; fires. Those events are lost to it, not queued.&lt;br /&gt;
* Coming back is a wake like any other. Every &amp;lt;code&amp;gt;unitptr&amp;lt;/code&amp;gt; variable that isn't secured is null afterwards, and [[Manual:DIL Manual/activator|activator]], [[Manual:DIL Manual/argument|argument]], [[Manual:DIL Manual/cmdstr|cmdstr]] and the others no longer describe the old event. Copy what you need into variables first.&lt;br /&gt;
* Secures are tested at the wake. If the command that was running took a secured unit away (a master who walked out, say), the program goes to that secure's label instead.&lt;br /&gt;
* Don't use it while a program before this one on the unit (lower [[Manual:DIL Manual/fnpri|fnpri]]) may hold [[Manual:DIL Manual/priority|priority]]: the wake is then dropped, and the program never runs again.&lt;br /&gt;
* basemove.zon (the &amp;lt;code&amp;gt;follow&amp;lt;/code&amp;gt; command) is the only user in the game.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin fnpri(FN_PRI_MISSION) tagalong();&lt;br /&gt;
var&lt;br /&gt;
   c : string;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
:start:&lt;br /&gt;
   wait(SFB_DONE, activator == self.master);&lt;br /&gt;
   if (command(&amp;quot;north&amp;quot;) or command(&amp;quot;east&amp;quot;) or command(&amp;quot;south&amp;quot;) or&lt;br /&gt;
       command(&amp;quot;west&amp;quot;) or command(&amp;quot;up&amp;quot;) or command(&amp;quot;down&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      c := cmdstr;&lt;br /&gt;
      waitnoop;&lt;br /&gt;
      exec(c, 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;
When its master has moved, the NPC takes the same exit, as &amp;lt;code&amp;gt;dilfollow&amp;lt;/code&amp;gt; in basemove.zon does. &amp;lt;code&amp;gt;cmdstr&amp;lt;/code&amp;gt; goes into &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; before the waitnoop, because it describes another event afterwards.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/wait()|wait()]]&lt;br /&gt;
* [[Manual:DIL Manual/exec()|exec()]]&lt;br /&gt;
* [[Manual:DIL Manual/secure()|secure()]]&lt;br /&gt;
* [[Manual:DIL Manual/SFB DONE|SFB_DONE]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>