<?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%2Fkey</id>
	<title>Manual:DIL Manual/key - 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%2Fkey"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/key&amp;action=history"/>
	<updated>2026-11-22T21:27:59Z</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/key&amp;diff=2813&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/key&amp;diff=2813&amp;oldid=prev"/>
		<updated>2026-11-14T23:00:06Z</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;= key =&lt;br /&gt;
'''Field''' (string, read/write; units: all, used on objects).&lt;br /&gt;
&lt;br /&gt;
 u.key : string&lt;br /&gt;
&lt;br /&gt;
The key that locks and unlocks the unit, as &amp;lt;code&amp;gt;&amp;quot;keyname@zone&amp;quot;&amp;lt;/code&amp;gt;, set with &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; in the zone file. Empty when the unit has no key. The lock and unlock commands in basemove.zon look for a unit with this symbolic name in the player's inventory.&lt;br /&gt;
&lt;br /&gt;
A room's exits have keys of their own: see [[Manual:DIL Manual/exit key|exit_key]].&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Assigning a string replaces the key; assigning &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; or null leaves the unit without one.&lt;br /&gt;
* Whether the unit can be locked at all is in [[Manual:DIL Manual/openflags|openflags]] (&amp;lt;code&amp;gt;EX_OPEN_CLOSE&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;EX_LOCKED&amp;lt;/code&amp;gt;).&lt;br /&gt;
* On null it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer has_key(pc : unitptr, item : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   k : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (item.key == &amp;quot;&amp;quot;)&lt;br /&gt;
      return (FALSE);&lt;br /&gt;
   k := findsymbolic(pc, item.key, FIND_UNIT_IN_ME);&lt;br /&gt;
   return (k != null);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells whether a player carries the key to an item, as lock and unlock do in basemove.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/exit key|exit_key]]&lt;br /&gt;
* [[Manual:DIL Manual/openflags|openflags]]&lt;br /&gt;
* [[Manual:DIL Manual/findsymbolic()|findsymbolic()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>