<?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%2Faware</id>
	<title>Manual:DIL Manual/aware - 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%2Faware"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/aware&amp;action=history"/>
	<updated>2026-11-22T20:52:02Z</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/aware&amp;diff=3125&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/aware&amp;diff=3125&amp;oldid=prev"/>
		<updated>2026-11-14T23:27:11Z</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;= aware =&lt;br /&gt;
'''Keyword.''' Option of &amp;lt;code&amp;gt;dilbegin&amp;lt;/code&amp;gt;: the program also hears what its own unit does.&lt;br /&gt;
&lt;br /&gt;
 dilbegin aware name(...);&lt;br /&gt;
&lt;br /&gt;
Normally a program is not woken by events its own unit causes: when the activator is the unit the program sits on, the event passes it by. A program on an NPC doesn't see the commands that NPC gives (also through &amp;lt;code&amp;gt;exec&amp;lt;/code&amp;gt;), and a program on a player doesn't see what the player types. With &amp;lt;code&amp;gt;aware&amp;lt;/code&amp;gt; the program gets those events too.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It only concerns events whose activator is the program's own unit, so in practice programs on characters: commands it gives (&amp;lt;code&amp;gt;SFB_CMD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SFB_DONE&amp;lt;/code&amp;gt;), messages it sends with &amp;lt;code&amp;gt;send()&amp;lt;/code&amp;gt;, and the like. A program on an object or a room hears the characters around it without &amp;lt;code&amp;gt;aware&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Some events always reach the unit's own programs: messages sent to it with &amp;lt;code&amp;gt;sendto()&amp;lt;/code&amp;gt;, the character's own death (&amp;lt;code&amp;gt;SFB_DEAD&amp;lt;/code&amp;gt;), ticks, and the prompt.&lt;br /&gt;
* An &amp;lt;code&amp;gt;aware&amp;lt;/code&amp;gt; program on a player that waits for &amp;lt;code&amp;gt;SFB_CMD&amp;lt;/code&amp;gt; wakes at every command the player types; test &amp;lt;code&amp;gt;activator == self&amp;lt;/code&amp;gt; and the command early and go back to waiting.&lt;br /&gt;
* The option is stored in each copy when it is made: adding or removing it doesn't change copies already saved on players' things.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin aware vow_silence();&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   :start:&lt;br /&gt;
   wait(SFB_CMD, (activator == self) and (command(&amp;quot;say&amp;quot;) or command(&amp;quot;shout&amp;quot;)));&lt;br /&gt;
   act(&amp;quot;You remember your vow of silence and hold your tongue.&amp;quot;,&lt;br /&gt;
       A_ALWAYS, self, null, null, TO_CHAR);&lt;br /&gt;
   block;&lt;br /&gt;
   goto start;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copied onto a player, it stops the player's own &amp;lt;code&amp;gt;say&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;shout&amp;lt;/code&amp;gt;. Without &amp;lt;code&amp;gt;aware&amp;lt;/code&amp;gt; it would never wake.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/dilbegin|dilbegin]]&lt;br /&gt;
* [[Manual:DIL Manual/activator|activator]]&lt;br /&gt;
* [[Manual:DIL Manual/wait()|wait()]]&lt;br /&gt;
* [[Manual:DIL Manual/send()|send()]]&lt;br /&gt;
* [[Manual:DIL Manual/sendto()|sendto()]]&lt;br /&gt;
* [[Manual:DIL Manual/block|block]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>