<?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%2Ffindzone%28%29</id>
	<title>Manual:DIL Manual/findzone() - 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%2Ffindzone%28%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/findzone()&amp;action=history"/>
	<updated>2026-11-24T03:48:16Z</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/findzone()&amp;diff=3010&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/findzone()&amp;diff=3010&amp;oldid=prev"/>
		<updated>2026-11-14T23:18:25Z</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;= findzone() =&lt;br /&gt;
'''Function''' (zoneptr). Finds a zone by its name.&lt;br /&gt;
&lt;br /&gt;
 findzone(zname : string) : zoneptr&lt;br /&gt;
&lt;br /&gt;
Returns the zone called &amp;lt;code&amp;gt;zname&amp;lt;/code&amp;gt;, the name after &amp;lt;code&amp;gt;%zone&amp;lt;/code&amp;gt; in its zone file (and after the &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; in symbolic names). With the zone you can read its fields (&amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;roomcount&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;resetmode&amp;lt;/code&amp;gt;...) or reset it with [[Manual:DIL Manual/zonereset()|zonereset()]].&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| zname || string || The zone's name, such as &amp;lt;code&amp;gt;&amp;quot;midgaard&amp;quot;&amp;lt;/code&amp;gt;, without an &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
The zone, or null when there is none of that name.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The name must match exactly, case included. Zone names are lower case, so &amp;lt;code&amp;gt;findzone(&amp;quot;Midgaard&amp;quot;)&amp;lt;/code&amp;gt; is null; use &amp;lt;code&amp;gt;tolower()&amp;lt;/code&amp;gt; on a name a player typed.&lt;br /&gt;
* The &amp;lt;code&amp;gt;zone&amp;lt;/code&amp;gt; field of a unit names the zone it is in now, so &amp;lt;code&amp;gt;findzone(u.zone)&amp;lt;/code&amp;gt; is that zone.&lt;br /&gt;
* To go through all zones, start at &amp;lt;code&amp;gt;zhead()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin do_zoneinfo(arg : string);&lt;br /&gt;
var&lt;br /&gt;
   z : zoneptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   z := findzone(tolower(getword(arg)));&lt;br /&gt;
   if (z == null)&lt;br /&gt;
   {&lt;br /&gt;
      sendtext(&amp;quot;No such zone.&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
      quit;&lt;br /&gt;
   }&lt;br /&gt;
   sendtext(&amp;quot;Zone &amp;quot; + z.name + &amp;quot; has &amp;quot; + itoa(z.roomcount) + &amp;quot; rooms.&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A command that looks a zone up by the name typed, as &amp;lt;code&amp;gt;cmd_reset&amp;lt;/code&amp;gt; in commands.zon does.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/zoneptr|zoneptr]]&lt;br /&gt;
* [[Manual:DIL Manual/zhead()|zhead()]]&lt;br /&gt;
* [[Manual:DIL Manual/zone|zone]]&lt;br /&gt;
* [[Manual:DIL Manual/zonereset()|zonereset()]]&lt;br /&gt;
* [[Manual:DIL Manual/findroom()|findroom()]]&lt;br /&gt;
* [[Manual:DIL Manual/tolower()|tolower()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>