<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Papi</id>
	<title>DikuMUD Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Papi"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/wiki/Special:Contributions/Papi"/>
	<updated>2026-07-26T01:09:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1272</id>
		<title>Manual:DIL Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1272"/>
		<updated>2025-12-06T22:39:14Z</updated>

		<summary type="html">&lt;p&gt;Papi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
'''You can view a full listing of the DIL manual at [[Manual:DIL_Manual_(Full_Listing)]] or browse by topic using the links below.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;AGENT.md&amp;lt;/h3&amp;gt;&lt;br /&gt;
Get the latest [https://github.com/Seifert69/DikuMUD3/blob/master/vme/doc/dil/AGENTS.md AGENTS.md on Github] to make your LLM create better code.&lt;br /&gt;
This [[Manual:DIL_Manual/AGENT|local copy]] is mostly for search engines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Index&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;PLEASE NOTE that the documentation in vme/doc/dil/*.wiki is much more comprehensive than the wiki. We're currently blocked from importing pages (315 of them)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Making a Program|Making a Program]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Data Types|Data Types]]&lt;br /&gt;
  [[Manual:DIL_Manual/string|string]]&lt;br /&gt;
  [[Manual:DIL_Manual/stringlist|stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/integer|integer]]&lt;br /&gt;
  [[Manual:DIL_Manual/integerlist|integerlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdptr|cmdptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/zoneptr|zoneptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Messages|Messages]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_CMD|SFB_CMD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DONE|SFB_DONE]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_TICK|SFB_TICK]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_COM|SFB_COM]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DEAD|SFB_DEAD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_MSG|SFB_MSG]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_PRE|SFB_PRE]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Variables|Built-In Variables]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdstr|cmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr|excmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr_case|excmdstr_case]]&lt;br /&gt;
  [[Manual:DIL_Manual/self|self]]&lt;br /&gt;
  [[Manual:DIL_Manual/activator|activator]]&lt;br /&gt;
  [[Manual:DIL_Manual/target|target]]&lt;br /&gt;
  [[Manual:DIL_Manual/medium|medium]]&lt;br /&gt;
  [[Manual:DIL_Manual/power|power]]&lt;br /&gt;
  [[Manual:DIL_Manual/argument|argument]]&lt;br /&gt;
  [[Manual:DIL_Manual/heartbeat|heartbeat]]&lt;br /&gt;
  [[Manual:DIL_Manual/null|null]]&lt;br /&gt;
  [[Manual:DIL_Manual/weather|weather]]&lt;br /&gt;
  [[Manual:DIL_Manual/realtime|realtime]]&lt;br /&gt;
  [[Manual:DIL_Manual/mud(day,month,..)|mud(day,month,..)]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/DIL Constructs|DIL Constructs]]&lt;br /&gt;
  [[Manual:DIL_Manual/if()|if()]]&lt;br /&gt;
  [[Manual:DIL_Manual/goto|goto]]&lt;br /&gt;
  [[Manual:DIL_Manual/while()|while()]]&lt;br /&gt;
  [[Manual:DIL_Manual/break|break]]&lt;br /&gt;
  [[Manual:DIL_Manual/continue|continue]]&lt;br /&gt;
  [[Manual:DIL_Manual/on ... goto ...|on ... goto ...]]&lt;br /&gt;
  [[Manual:DIL_Manual/foreach()|foreach()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Assignment|Assignment]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Expressions|Expressions]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Operators|Operators]]&lt;br /&gt;
  [[Manual:DIL_Manual/in|in]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in string|string in string]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in stringlist|string in stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in extraptr|string in extraptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Functions|Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/quit|quit]]&lt;br /&gt;
  [[Manual:DIL_Manual/return|return]]&lt;br /&gt;
  [[Manual:DIL_Manual/return()|return()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Fields|Fields]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_OBJ|UNIT_ST_OBJ]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_ROOM|UNIT_ST_ROOM]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC and UNIT_ST_NPC|UNIT_ST_PC and UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_NPC|UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC|UNIT_ST_PC]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Functions|Built-In Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/asctime()|asctime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strcmp()|strcmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strncmp()|strncmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/textformat()|textformat()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellindex()|spellindex()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellinfo()|spellinfo()]]&lt;br /&gt;
  [[Manual:DIL_Manual/beginedit()|beginedit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cancarry()|cancarry()]]&lt;br /&gt;
  [[Manual:DIL_Manual/fits()|fits()]]&lt;br /&gt;
  [[Manual:DIL_Manual/replace()|replace()]]&lt;br /&gt;
  [[Manual:DIL_Manual/restore()|restore()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleeattack()|meleeattack()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleedamage()|meleedamage()]]&lt;br /&gt;
  [[Manual:DIL_Manual/mid()|mid()]]&lt;br /&gt;
  [[Manual:DIL_Manual/moneystring()|moneystring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/equipment()|equipment()]]&lt;br /&gt;
  [[Manual:DIL_Manual/tolower()|tolower()]]&lt;br /&gt;
  [[Manual:DIL_Manual/toupper()|toupper()]]&lt;br /&gt;
  [[Manual:DIL_Manual/visible()|visible()]]&lt;br /&gt;
  [[Manual:DIL_Manual/opponent()|opponent()]]&lt;br /&gt;
  [[Manual:DIL_Manual/purse()|purse()]]&lt;br /&gt;
  [[Manual:DIL_Manual/atoi()|atoi()]]&lt;br /&gt;
  [[Manual:DIL_Manual/check_password()|check_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/command()|command()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delstr()|delstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delunit()|delunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dildestroy()|dildestroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilfind()|dilfind()]]&lt;br /&gt;
  [[Manual:DIL_Manual/itoa()|itoa()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isaff()|isaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/islight()|islight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isplayer()|isplayer()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isset()|isset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/paycheck()|paycheck()]]&lt;br /&gt;
  [[Manual:DIL_Manual/filesize()|filesize()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findunit()|findunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findrndunit()|findrndunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findroom()|findroom()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findsymbolic()|findsymbolic()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getword()|getword()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getwords()|getwords()]]&lt;br /&gt;
  [[Manual:DIL_Manual/ghead()|ghead()]]&lt;br /&gt;
  [[Manual:DIL_Manual/split()|split()]]&lt;br /&gt;
  [[Manual:DIL_Manual/left()|left()]]&lt;br /&gt;
  [[Manual:DIL_Manual/length()|length()]]&lt;br /&gt;
  [[Manual:DIL_Manual/load()|load()]]&lt;br /&gt;
  [[Manual:DIL_Manual/loadstr()|loadstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/openroll()|openroll()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pathto()|pathto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pagestring()|pagestring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/right()|right()]]&lt;br /&gt;
  [[Manual:DIL_Manual/rnd()|rnd()]]&lt;br /&gt;
  [[Manual:DIL_Manual/Built-In Procedures|Built-In Procedures]]&lt;br /&gt;
  [[Manual:DIL_Manual/follow()|follow()]]&lt;br /&gt;
  [[Manual:DIL_Manual/flog()|flog()]]&lt;br /&gt;
  [[Manual:DIL_Manual/logcrime()|logcrime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/acc_modify()|acc_modify()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strdir()|strdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_password()|set_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/store()|store()]]&lt;br /&gt;
  [[Manual:DIL_Manual/position_update()|position_update()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_done()|send_done()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_pre()|send_pre()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set()|set()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unset()|unset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addcolor()|addcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delcolor()|delcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getcolor()|getcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/changecolor()|changecolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/gamestate()|gamestate()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addextra()|addextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addstring()|addstring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subextra()|subextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/substring()|substring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/stop_fighting()|stop_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subaff()|subaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addaff()|addaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/destroy()|destroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/walkto()|walkto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/link()|link()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_name()|weapon_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_info()|weapon_info()]]&lt;br /&gt;
  [[Manual:DIL_Manual/skill_name()|skill_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reboot|reboot]]&lt;br /&gt;
  [[Manual:DIL_Manual/killedit|killedit]]&lt;br /&gt;
  [[Manual:DIL_Manual/experience()|experience()]]&lt;br /&gt;
  [[Manual:DIL_Manual/act()|act()]]&lt;br /&gt;
  [[Manual:DIL_Manual/exec()|exec()]]&lt;br /&gt;
  [[Manual:DIL_Manual/wait()|wait()]]&lt;br /&gt;
  [[Manual:DIL_Manual/savestr()|savestr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/remove()|remove()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_level()|reset_level()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_vlevel()|reset_vlevel()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_race()|reset_race()]]&lt;br /&gt;
  [[Manual:DIL_Manual/secure()|secure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitdir()|unitdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unsecure()|unsecure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/block|block]]&lt;br /&gt;
  [[Manual:DIL_Manual/priority|priority]]&lt;br /&gt;
  [[Manual:DIL_Manual/nopriority|nopriority]]&lt;br /&gt;
  [[Manual:DIL_Manual/addequip()|addequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unequip()|unequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delete_player()|delete_player()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilcopy()|dilcopy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtext()|sendtext()]]&lt;br /&gt;
  [[Manual:DIL_Manual/change_speed()|change_speed()]]&lt;br /&gt;
  [[Manual:DIL_Manual/transfermoney()|transfermoney()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_fighting()|set_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight_base|set_weight_base()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight|set_weight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/setbright()|setbright()]]&lt;br /&gt;
  [[Manual:DIL_Manual/log()|log()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send()|send()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendto()|sendto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoall()|sendtoall()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoalldil()|sendtoalldil()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cast_spell()|cast_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/attack_spell()|attack_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/insert()|insert()]]&lt;br /&gt;
  [[Manual:DIL_Manual/interrupt()|interrupt()]]&lt;br /&gt;
  [[Manual:DIL_Manual/clear()|clear()]]&lt;br /&gt;
  [[Manual:DIL_Manual/on_activation()|on_activation()]]&lt;br /&gt;
  [[Manual:DIL_Manual/shell()|shell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getaffects()|getaffects()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Ending Notes|Ending Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Manual Title Pages]]&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1271</id>
		<title>Manual:DIL Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1271"/>
		<updated>2025-12-06T07:47:07Z</updated>

		<summary type="html">&lt;p&gt;Papi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
'''You can view a full listing of the DIL manual at [[Manual:DIL_Manual_(Full_Listing)]] or browse by topic using the links below.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;AGENT.md&amp;lt;/h3&amp;gt;&lt;br /&gt;
Get the latest [https://github.com/Seifert69/DikuMUD3/blob/master/vme/doc/dil/AGENT.md AGENT.md on Github] to make your LLM create better code.&lt;br /&gt;
This [[Manual:DIL_Manual/AGENT|local copy]] is mostly for search engines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Index&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;PLEASE NOTE that the documentation in vme/doc/dil/*.wiki is much more comprehensive than the wiki. We're currently blocked from importing pages (315 of them)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Making a Program|Making a Program]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Data Types|Data Types]]&lt;br /&gt;
  [[Manual:DIL_Manual/string|string]]&lt;br /&gt;
  [[Manual:DIL_Manual/stringlist|stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/integer|integer]]&lt;br /&gt;
  [[Manual:DIL_Manual/integerlist|integerlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdptr|cmdptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/zoneptr|zoneptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Messages|Messages]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_CMD|SFB_CMD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DONE|SFB_DONE]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_TICK|SFB_TICK]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_COM|SFB_COM]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DEAD|SFB_DEAD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_MSG|SFB_MSG]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_PRE|SFB_PRE]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Variables|Built-In Variables]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdstr|cmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr|excmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr_case|excmdstr_case]]&lt;br /&gt;
  [[Manual:DIL_Manual/self|self]]&lt;br /&gt;
  [[Manual:DIL_Manual/activator|activator]]&lt;br /&gt;
  [[Manual:DIL_Manual/target|target]]&lt;br /&gt;
  [[Manual:DIL_Manual/medium|medium]]&lt;br /&gt;
  [[Manual:DIL_Manual/power|power]]&lt;br /&gt;
  [[Manual:DIL_Manual/argument|argument]]&lt;br /&gt;
  [[Manual:DIL_Manual/heartbeat|heartbeat]]&lt;br /&gt;
  [[Manual:DIL_Manual/null|null]]&lt;br /&gt;
  [[Manual:DIL_Manual/weather|weather]]&lt;br /&gt;
  [[Manual:DIL_Manual/realtime|realtime]]&lt;br /&gt;
  [[Manual:DIL_Manual/mud(day,month,..)|mud(day,month,..)]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/DIL Constructs|DIL Constructs]]&lt;br /&gt;
  [[Manual:DIL_Manual/if()|if()]]&lt;br /&gt;
  [[Manual:DIL_Manual/goto|goto]]&lt;br /&gt;
  [[Manual:DIL_Manual/while()|while()]]&lt;br /&gt;
  [[Manual:DIL_Manual/break|break]]&lt;br /&gt;
  [[Manual:DIL_Manual/continue|continue]]&lt;br /&gt;
  [[Manual:DIL_Manual/on ... goto ...|on ... goto ...]]&lt;br /&gt;
  [[Manual:DIL_Manual/foreach()|foreach()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Assignment|Assignment]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Expressions|Expressions]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Operators|Operators]]&lt;br /&gt;
  [[Manual:DIL_Manual/in|in]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in string|string in string]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in stringlist|string in stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in extraptr|string in extraptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Functions|Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/quit|quit]]&lt;br /&gt;
  [[Manual:DIL_Manual/return|return]]&lt;br /&gt;
  [[Manual:DIL_Manual/return()|return()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Fields|Fields]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_OBJ|UNIT_ST_OBJ]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_ROOM|UNIT_ST_ROOM]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC and UNIT_ST_NPC|UNIT_ST_PC and UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_NPC|UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC|UNIT_ST_PC]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Functions|Built-In Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/asctime()|asctime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strcmp()|strcmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strncmp()|strncmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/textformat()|textformat()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellindex()|spellindex()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellinfo()|spellinfo()]]&lt;br /&gt;
  [[Manual:DIL_Manual/beginedit()|beginedit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cancarry()|cancarry()]]&lt;br /&gt;
  [[Manual:DIL_Manual/fits()|fits()]]&lt;br /&gt;
  [[Manual:DIL_Manual/replace()|replace()]]&lt;br /&gt;
  [[Manual:DIL_Manual/restore()|restore()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleeattack()|meleeattack()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleedamage()|meleedamage()]]&lt;br /&gt;
  [[Manual:DIL_Manual/mid()|mid()]]&lt;br /&gt;
  [[Manual:DIL_Manual/moneystring()|moneystring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/equipment()|equipment()]]&lt;br /&gt;
  [[Manual:DIL_Manual/tolower()|tolower()]]&lt;br /&gt;
  [[Manual:DIL_Manual/toupper()|toupper()]]&lt;br /&gt;
  [[Manual:DIL_Manual/visible()|visible()]]&lt;br /&gt;
  [[Manual:DIL_Manual/opponent()|opponent()]]&lt;br /&gt;
  [[Manual:DIL_Manual/purse()|purse()]]&lt;br /&gt;
  [[Manual:DIL_Manual/atoi()|atoi()]]&lt;br /&gt;
  [[Manual:DIL_Manual/check_password()|check_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/command()|command()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delstr()|delstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delunit()|delunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dildestroy()|dildestroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilfind()|dilfind()]]&lt;br /&gt;
  [[Manual:DIL_Manual/itoa()|itoa()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isaff()|isaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/islight()|islight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isplayer()|isplayer()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isset()|isset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/paycheck()|paycheck()]]&lt;br /&gt;
  [[Manual:DIL_Manual/filesize()|filesize()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findunit()|findunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findrndunit()|findrndunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findroom()|findroom()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findsymbolic()|findsymbolic()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getword()|getword()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getwords()|getwords()]]&lt;br /&gt;
  [[Manual:DIL_Manual/ghead()|ghead()]]&lt;br /&gt;
  [[Manual:DIL_Manual/split()|split()]]&lt;br /&gt;
  [[Manual:DIL_Manual/left()|left()]]&lt;br /&gt;
  [[Manual:DIL_Manual/length()|length()]]&lt;br /&gt;
  [[Manual:DIL_Manual/load()|load()]]&lt;br /&gt;
  [[Manual:DIL_Manual/loadstr()|loadstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/openroll()|openroll()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pathto()|pathto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pagestring()|pagestring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/right()|right()]]&lt;br /&gt;
  [[Manual:DIL_Manual/rnd()|rnd()]]&lt;br /&gt;
  [[Manual:DIL_Manual/Built-In Procedures|Built-In Procedures]]&lt;br /&gt;
  [[Manual:DIL_Manual/follow()|follow()]]&lt;br /&gt;
  [[Manual:DIL_Manual/flog()|flog()]]&lt;br /&gt;
  [[Manual:DIL_Manual/logcrime()|logcrime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/acc_modify()|acc_modify()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strdir()|strdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_password()|set_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/store()|store()]]&lt;br /&gt;
  [[Manual:DIL_Manual/position_update()|position_update()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_done()|send_done()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_pre()|send_pre()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set()|set()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unset()|unset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addcolor()|addcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delcolor()|delcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getcolor()|getcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/changecolor()|changecolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/gamestate()|gamestate()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addextra()|addextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addstring()|addstring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subextra()|subextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/substring()|substring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/stop_fighting()|stop_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subaff()|subaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addaff()|addaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/destroy()|destroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/walkto()|walkto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/link()|link()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_name()|weapon_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_info()|weapon_info()]]&lt;br /&gt;
  [[Manual:DIL_Manual/skill_name()|skill_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reboot|reboot]]&lt;br /&gt;
  [[Manual:DIL_Manual/killedit|killedit]]&lt;br /&gt;
  [[Manual:DIL_Manual/experience()|experience()]]&lt;br /&gt;
  [[Manual:DIL_Manual/act()|act()]]&lt;br /&gt;
  [[Manual:DIL_Manual/exec()|exec()]]&lt;br /&gt;
  [[Manual:DIL_Manual/wait()|wait()]]&lt;br /&gt;
  [[Manual:DIL_Manual/savestr()|savestr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/remove()|remove()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_level()|reset_level()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_vlevel()|reset_vlevel()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_race()|reset_race()]]&lt;br /&gt;
  [[Manual:DIL_Manual/secure()|secure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitdir()|unitdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unsecure()|unsecure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/block|block]]&lt;br /&gt;
  [[Manual:DIL_Manual/priority|priority]]&lt;br /&gt;
  [[Manual:DIL_Manual/nopriority|nopriority]]&lt;br /&gt;
  [[Manual:DIL_Manual/addequip()|addequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unequip()|unequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delete_player()|delete_player()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilcopy()|dilcopy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtext()|sendtext()]]&lt;br /&gt;
  [[Manual:DIL_Manual/change_speed()|change_speed()]]&lt;br /&gt;
  [[Manual:DIL_Manual/transfermoney()|transfermoney()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_fighting()|set_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight_base|set_weight_base()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight|set_weight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/setbright()|setbright()]]&lt;br /&gt;
  [[Manual:DIL_Manual/log()|log()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send()|send()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendto()|sendto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoall()|sendtoall()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoalldil()|sendtoalldil()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cast_spell()|cast_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/attack_spell()|attack_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/insert()|insert()]]&lt;br /&gt;
  [[Manual:DIL_Manual/interrupt()|interrupt()]]&lt;br /&gt;
  [[Manual:DIL_Manual/clear()|clear()]]&lt;br /&gt;
  [[Manual:DIL_Manual/on_activation()|on_activation()]]&lt;br /&gt;
  [[Manual:DIL_Manual/shell()|shell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getaffects()|getaffects()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Ending Notes|Ending Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Manual Title Pages]]&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1270</id>
		<title>Manual:DIL Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1270"/>
		<updated>2025-12-06T07:46:09Z</updated>

		<summary type="html">&lt;p&gt;Papi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
'''You can view a full listing of the DIL manual at [[Manual:DIL_Manual_(Full_Listing)]] or browse by topic using the links below.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;AGENT.md&amp;lt;/h3&amp;gt;&lt;br /&gt;
Get the latest [https://github.com/Seifert69/DikuMUD3/blob/master/vme/doc/dil/AGENT.md AGENT.md on Github] to make your LLM create better code.&lt;br /&gt;
This [[Manual:DIL_Manual/AGENT|local copy]] is mostly for search engines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Index&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Making a Program|Making a Program]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Data Types|Data Types]]&lt;br /&gt;
  [[Manual:DIL_Manual/string|string]]&lt;br /&gt;
  [[Manual:DIL_Manual/stringlist|stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/integer|integer]]&lt;br /&gt;
  [[Manual:DIL_Manual/integerlist|integerlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdptr|cmdptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/zoneptr|zoneptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Messages|Messages]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_CMD|SFB_CMD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DONE|SFB_DONE]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_TICK|SFB_TICK]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_COM|SFB_COM]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DEAD|SFB_DEAD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_MSG|SFB_MSG]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_PRE|SFB_PRE]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Variables|Built-In Variables]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdstr|cmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr|excmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr_case|excmdstr_case]]&lt;br /&gt;
  [[Manual:DIL_Manual/self|self]]&lt;br /&gt;
  [[Manual:DIL_Manual/activator|activator]]&lt;br /&gt;
  [[Manual:DIL_Manual/target|target]]&lt;br /&gt;
  [[Manual:DIL_Manual/medium|medium]]&lt;br /&gt;
  [[Manual:DIL_Manual/power|power]]&lt;br /&gt;
  [[Manual:DIL_Manual/argument|argument]]&lt;br /&gt;
  [[Manual:DIL_Manual/heartbeat|heartbeat]]&lt;br /&gt;
  [[Manual:DIL_Manual/null|null]]&lt;br /&gt;
  [[Manual:DIL_Manual/weather|weather]]&lt;br /&gt;
  [[Manual:DIL_Manual/realtime|realtime]]&lt;br /&gt;
  [[Manual:DIL_Manual/mud(day,month,..)|mud(day,month,..)]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/DIL Constructs|DIL Constructs]]&lt;br /&gt;
  [[Manual:DIL_Manual/if()|if()]]&lt;br /&gt;
  [[Manual:DIL_Manual/goto|goto]]&lt;br /&gt;
  [[Manual:DIL_Manual/while()|while()]]&lt;br /&gt;
  [[Manual:DIL_Manual/break|break]]&lt;br /&gt;
  [[Manual:DIL_Manual/continue|continue]]&lt;br /&gt;
  [[Manual:DIL_Manual/on ... goto ...|on ... goto ...]]&lt;br /&gt;
  [[Manual:DIL_Manual/foreach()|foreach()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Assignment|Assignment]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Expressions|Expressions]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Operators|Operators]]&lt;br /&gt;
  [[Manual:DIL_Manual/in|in]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in string|string in string]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in stringlist|string in stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in extraptr|string in extraptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Functions|Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/quit|quit]]&lt;br /&gt;
  [[Manual:DIL_Manual/return|return]]&lt;br /&gt;
  [[Manual:DIL_Manual/return()|return()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Fields|Fields]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_OBJ|UNIT_ST_OBJ]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_ROOM|UNIT_ST_ROOM]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC and UNIT_ST_NPC|UNIT_ST_PC and UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_NPC|UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC|UNIT_ST_PC]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Functions|Built-In Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/asctime()|asctime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strcmp()|strcmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strncmp()|strncmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/textformat()|textformat()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellindex()|spellindex()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellinfo()|spellinfo()]]&lt;br /&gt;
  [[Manual:DIL_Manual/beginedit()|beginedit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cancarry()|cancarry()]]&lt;br /&gt;
  [[Manual:DIL_Manual/fits()|fits()]]&lt;br /&gt;
  [[Manual:DIL_Manual/replace()|replace()]]&lt;br /&gt;
  [[Manual:DIL_Manual/restore()|restore()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleeattack()|meleeattack()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleedamage()|meleedamage()]]&lt;br /&gt;
  [[Manual:DIL_Manual/mid()|mid()]]&lt;br /&gt;
  [[Manual:DIL_Manual/moneystring()|moneystring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/equipment()|equipment()]]&lt;br /&gt;
  [[Manual:DIL_Manual/tolower()|tolower()]]&lt;br /&gt;
  [[Manual:DIL_Manual/toupper()|toupper()]]&lt;br /&gt;
  [[Manual:DIL_Manual/visible()|visible()]]&lt;br /&gt;
  [[Manual:DIL_Manual/opponent()|opponent()]]&lt;br /&gt;
  [[Manual:DIL_Manual/purse()|purse()]]&lt;br /&gt;
  [[Manual:DIL_Manual/atoi()|atoi()]]&lt;br /&gt;
  [[Manual:DIL_Manual/check_password()|check_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/command()|command()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delstr()|delstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delunit()|delunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dildestroy()|dildestroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilfind()|dilfind()]]&lt;br /&gt;
  [[Manual:DIL_Manual/itoa()|itoa()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isaff()|isaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/islight()|islight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isplayer()|isplayer()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isset()|isset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/paycheck()|paycheck()]]&lt;br /&gt;
  [[Manual:DIL_Manual/filesize()|filesize()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findunit()|findunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findrndunit()|findrndunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findroom()|findroom()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findsymbolic()|findsymbolic()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getword()|getword()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getwords()|getwords()]]&lt;br /&gt;
  [[Manual:DIL_Manual/ghead()|ghead()]]&lt;br /&gt;
  [[Manual:DIL_Manual/split()|split()]]&lt;br /&gt;
  [[Manual:DIL_Manual/left()|left()]]&lt;br /&gt;
  [[Manual:DIL_Manual/length()|length()]]&lt;br /&gt;
  [[Manual:DIL_Manual/load()|load()]]&lt;br /&gt;
  [[Manual:DIL_Manual/loadstr()|loadstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/openroll()|openroll()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pathto()|pathto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pagestring()|pagestring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/right()|right()]]&lt;br /&gt;
  [[Manual:DIL_Manual/rnd()|rnd()]]&lt;br /&gt;
  [[Manual:DIL_Manual/Built-In Procedures|Built-In Procedures]]&lt;br /&gt;
  [[Manual:DIL_Manual/follow()|follow()]]&lt;br /&gt;
  [[Manual:DIL_Manual/flog()|flog()]]&lt;br /&gt;
  [[Manual:DIL_Manual/logcrime()|logcrime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/acc_modify()|acc_modify()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strdir()|strdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_password()|set_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/store()|store()]]&lt;br /&gt;
  [[Manual:DIL_Manual/position_update()|position_update()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_done()|send_done()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_pre()|send_pre()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set()|set()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unset()|unset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addcolor()|addcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delcolor()|delcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getcolor()|getcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/changecolor()|changecolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/gamestate()|gamestate()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addextra()|addextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addstring()|addstring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subextra()|subextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/substring()|substring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/stop_fighting()|stop_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subaff()|subaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addaff()|addaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/destroy()|destroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/walkto()|walkto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/link()|link()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_name()|weapon_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_info()|weapon_info()]]&lt;br /&gt;
  [[Manual:DIL_Manual/skill_name()|skill_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reboot|reboot]]&lt;br /&gt;
  [[Manual:DIL_Manual/killedit|killedit]]&lt;br /&gt;
  [[Manual:DIL_Manual/experience()|experience()]]&lt;br /&gt;
  [[Manual:DIL_Manual/act()|act()]]&lt;br /&gt;
  [[Manual:DIL_Manual/exec()|exec()]]&lt;br /&gt;
  [[Manual:DIL_Manual/wait()|wait()]]&lt;br /&gt;
  [[Manual:DIL_Manual/savestr()|savestr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/remove()|remove()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_level()|reset_level()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_vlevel()|reset_vlevel()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_race()|reset_race()]]&lt;br /&gt;
  [[Manual:DIL_Manual/secure()|secure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitdir()|unitdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unsecure()|unsecure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/block|block]]&lt;br /&gt;
  [[Manual:DIL_Manual/priority|priority]]&lt;br /&gt;
  [[Manual:DIL_Manual/nopriority|nopriority]]&lt;br /&gt;
  [[Manual:DIL_Manual/addequip()|addequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unequip()|unequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delete_player()|delete_player()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilcopy()|dilcopy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtext()|sendtext()]]&lt;br /&gt;
  [[Manual:DIL_Manual/change_speed()|change_speed()]]&lt;br /&gt;
  [[Manual:DIL_Manual/transfermoney()|transfermoney()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_fighting()|set_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight_base|set_weight_base()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight|set_weight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/setbright()|setbright()]]&lt;br /&gt;
  [[Manual:DIL_Manual/log()|log()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send()|send()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendto()|sendto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoall()|sendtoall()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoalldil()|sendtoalldil()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cast_spell()|cast_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/attack_spell()|attack_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/insert()|insert()]]&lt;br /&gt;
  [[Manual:DIL_Manual/interrupt()|interrupt()]]&lt;br /&gt;
  [[Manual:DIL_Manual/clear()|clear()]]&lt;br /&gt;
  [[Manual:DIL_Manual/on_activation()|on_activation()]]&lt;br /&gt;
  [[Manual:DIL_Manual/shell()|shell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getaffects()|getaffects()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Ending Notes|Ending Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Manual Title Pages]]&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/AGENT&amp;diff=1269</id>
		<title>Manual:DIL Manual/AGENT</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/AGENT&amp;diff=1269"/>
		<updated>2025-12-06T07:44:41Z</updated>

		<summary type="html">&lt;p&gt;Papi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# DikuMUD3 DIL (DikuMUD Interactive Language) Reference&lt;br /&gt;
&lt;br /&gt;
This document provides a comprehensive AGENT.md reference for DIL - the scripting language used in DikuMUD3 for creating interactive game content, NPCs, objects and complex game systems. &lt;br /&gt;
&lt;br /&gt;
## Compiling a zone&lt;br /&gt;
To compile a zone: cd vme/zone/ &amp;amp;&amp;amp; vme/bin/vmc -I../include/ zonename.zon&lt;br /&gt;
&lt;br /&gt;
## Zones with good DIL examples&lt;br /&gt;
- vme/zone/haon_dor.zon&lt;br /&gt;
- vme/zone/udgaard.zon&lt;br /&gt;
- vme/zone/midgaard.zon&lt;br /&gt;
- vme/zone/cypress.zon&lt;br /&gt;
&lt;br /&gt;
## Quest helper DIL functions&lt;br /&gt;
Look in **vme/zone/quests.zon** for the DIL library of quest helper functions broadly exemplified in **vme/zone/haon-dor.zon**.&lt;br /&gt;
Look in **vme/zone/randomt.zon** for generating random treasure in DIL.&lt;br /&gt;
&lt;br /&gt;
## 📚 **Core Documentation**&lt;br /&gt;
**🔗 Quick Access**: This condensed list covers all 314+ DIL language features. Each entry is reference their respective .wiki files in the DikuMUD3 DIL Manual documentation system. [string] for example is detailed in **vme/src/mcp/string.wiki**&lt;br /&gt;
&lt;br /&gt;
## 🔧 **Language Overview**&lt;br /&gt;
&lt;br /&gt;
### Data Types&lt;br /&gt;
- **[integer]** - Numeric data type: `health := 100; damage := 25; remaining := health - damage;`&lt;br /&gt;
- **[string]** - Text data type: `name := &amp;quot;Player&amp;quot;; message := name + &amp;quot; has &amp;quot; + itoa(health) + &amp;quot; HP&amp;quot;;`&lt;br /&gt;
- **[unitptr]** - Unit pointer: `target := activator; npc := findunit(&amp;quot;guard&amp;quot;, UNIT_ST_NPC);`&lt;br /&gt;
- **[integerlist]** - Integer collections: `skills := {5, 3, 6, 9}; level := skills.[2]; // == 6`&lt;br /&gt;
- **[stringlist]** - String collections: `names := {&amp;quot;Alice&amp;quot;,&amp;quot;Bob&amp;quot;,&amp;quot;Charlie&amp;quot;}; first := names.[0];`&lt;br /&gt;
- **[null]** - Null value: `if (self.fighting == null) { /* not fighting anyone */ }`&lt;br /&gt;
&lt;br /&gt;
### Type Conversion&lt;br /&gt;
- **[atoi]** - String to integer: `num := atoi(&amp;quot;42&amp;quot;); // num == 42`&lt;br /&gt;
- **[itoa]** - Integer to string: `str := itoa(100); // str == &amp;quot;100&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
### Built-in Variables&lt;br /&gt;
- **[self]** - Current executing unit: `hp_pct := (self.hp * 100) / self.max_hp;`&lt;br /&gt;
- **[activator]** - Unit that triggered program: `if (activator.level &amp;gt;= IMMORTAL_LEVEL) { /* admin access */ }`&lt;br /&gt;
- **[argument]** - Command arguments: `wait(SFB_CMD, command(&amp;quot;hello&amp;quot;)); if (argument != &amp;quot;&amp;quot;) { send(&amp;quot;Hello &amp;quot; + argument + &amp;quot;!&amp;quot;); }`&lt;br /&gt;
- **[command]** - Command name: `if (command(&amp;quot;north&amp;quot;)) { act(&amp;quot;You go north.&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[cmdstr]** - Full command string: `full_cmd := cmdstr + &amp;quot; &amp;quot; + argument; act(&amp;quot;Full: &amp;quot; + full_cmd, A_ALWAYS, self, null, null, TO_CHAR);`&lt;br /&gt;
- **[cmdptr]** - Command pointer: `cmd := getcommand(&amp;quot;say&amp;quot;); if (cmd) { send(&amp;quot;Command level: &amp;quot; + itoa(cmd.level), self); }`&lt;br /&gt;
- **[excmdstr]** - Command string (lowercase): `if (excmdstr != &amp;quot;quit&amp;quot;) { sendtext(&amp;quot;You must type 'quit' to quit.&amp;quot;, self); }`&lt;br /&gt;
- **[excmdstr_case]** - Command string (case-sensitive): `if (length(excmdstr_case) &amp;lt; 5) { sendtext(&amp;quot;Password too short.&amp;quot;, self); }`&lt;br /&gt;
- **[heartbeat]** - Program timing: `heartbeat := PULSE_SEC * 10; // Tick every 10 seconds`&lt;br /&gt;
- **[medium]** - Operation medium: `container := medium; if (container != null) { act(&amp;quot;Using $1n as medium.&amp;quot;, A_ALWAYS, self, container, null, TO_CHAR); }`&lt;br /&gt;
- **[power]** - Action power: `if (power &amp;gt; 100) { sendtext(&amp;quot;This is a very powerful spell!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Control Structures&lt;br /&gt;
- **[if]** - Conditional statement: `if (self.hp &amp;gt; 10) { exec(&amp;quot;say Hehe!&amp;quot;, self); } else { exec(&amp;quot;say ouch!&amp;quot;, self); }`&lt;br /&gt;
- **[while]** - Loop construct: `while (self.inside) { if (self.position &amp;amp; POSITION_SLEEPING) break; pause; }`&lt;br /&gt;
- **[foreach]** - Loop construct: `foreach (UNIT_ST_PC|UNIT_ST_NPC, u) { if (u.hp &amp;lt; u.max_hp) { u.hp := u.hp + 6; } pause; }`&lt;br /&gt;
- **[goto]** - Unconditional jump: `:main_loop: pause; goto main_loop; // Create infinite loop`&lt;br /&gt;
- **[on_goto]** - Goto construct: `on direction goto (north, south, east, west); // 0=north, 1=south, etc.`&lt;br /&gt;
- **[break]** - Exit loop: `foreach (UNIT_ST_PC, target) { if (target.hp &amp;lt; target.max_hp / 2) { break; } }`&lt;br /&gt;
- **[continue]** - Continue iteration: `foreach (UNIT_ST_OBJ, item) { if (not isset(item.manipulate, MANIPULATE_TAKE)) continue; }`&lt;br /&gt;
- **[return]** - Return from function: `return(damage); // Functions: return value; Procedures: return;`&lt;br /&gt;
- **[quit]** - Terminate program: `if (input == &amp;quot;exit&amp;quot;) { sendtext(&amp;quot;Goodbye!&amp;quot;, self); quit; }`&lt;br /&gt;
- **[block]** - Block commands: `wait(SFB_CMD, command(&amp;quot;forbidden&amp;quot;)); block; send(&amp;quot;Command blocked!&amp;quot;, activator);`&lt;br /&gt;
&lt;br /&gt;
**⚠️ IMPORTANT:** DIL does NOT support C-style `for` loops. Use `while` loops instead.&lt;br /&gt;
&lt;br /&gt;
### Operators&lt;br /&gt;
- **[and]** - Logical operators: `if (self.level &amp;gt;= 10 and self.hp &amp;gt; 50) { /* ready for combat */ }`&lt;br /&gt;
- **[or]** - Logical operators: `if (self.level &amp;lt; 10 or self.hp &amp;lt;= 0) { /* not ready */ }`&lt;br /&gt;
- **[not]** - Logical operators: `if (not (self.fighting)) { /* not in combat */ }`&lt;br /&gt;
- **[set]** - Bit operations: `set(self.pcflags, PC_WIZARD); // Set wizard mode flag`&lt;br /&gt;
- **[unset]** - Bit operations: `unset(self.charflags, CHAR_SELF_DEFENCE); // Clear defence flag`&lt;br /&gt;
- **[isset]** - Bit operations: `if (isset(self.flags, UNIT_FL_BURIED)) { /* item is buried */ }`&lt;br /&gt;
&lt;br /&gt;
### Unit Fields&lt;br /&gt;
- **[type]** - Unit type: `if (target.type == UNIT_ST_PC) { sendtext(&amp;quot;This is a player character.&amp;quot;, self); }`&lt;br /&gt;
- **[inside]** - Unit positioning: `item := chest.inside; if (item != null) { sendtext(&amp;quot;Found: &amp;quot; + item.name, self); }`&lt;br /&gt;
- **[outside]** - Unit positioning: `container := item.outside; if (container != null) { act(&amp;quot;$1n is in $2n&amp;quot;, A_ALWAYS, self, item, container, TO_CHAR); }`&lt;br /&gt;
- **[bright]** - Lighting: `torch_brightness := bright(self); sendtext(&amp;quot;Torch brightness: &amp;quot; + itoa(torch_brightness), self);`&lt;br /&gt;
- **[setbright]** - Set brightness: `setbright(torch, 3); // Make torch emit more light`&lt;br /&gt;
- **[light]** - Lighting: `light_count := self.light; sendtext(&amp;quot;This unit contains &amp;quot; + itoa(light_count) + &amp;quot; light sources.&amp;quot;, self); }`&lt;br /&gt;
- **[illum]** - Contained light: `if (container.illum &amp;gt; 0) { sendtext(&amp;quot;Container glows from within.&amp;quot;, self); }`&lt;br /&gt;
- **[name]** - Object identification: `item_name := item.name; sendtext(&amp;quot;This is called: &amp;quot; + item_name, self); }`&lt;br /&gt;
- **[title]** - Object identification: `obj.title := &amp;quot;A shiny sword&amp;quot;; sendtext(&amp;quot;Item title updated to: &amp;quot; + obj.title, self); }`&lt;br /&gt;
- **[descr]** - Object identification: `extra.descr := &amp;quot;This item glows with magical energy.&amp;quot;; // Set extra description`&lt;br /&gt;
- **[inside_descr]** - Internal description: `room.inside_descr := &amp;quot;This room has been modified.&amp;quot;; // Change room description`&lt;br /&gt;
- **[outside_descr]** - External description: `target.outside_descr := &amp;quot;A mysterious figure stands here.&amp;quot;; // Set external description`&lt;br /&gt;
- **[weight]** - Weight: `total_weight := pc.weight; capacity := pc.capacity; if (total_weight &amp;gt; capacity) { /* overburdened */ }`&lt;br /&gt;
- **[baseweight]** - Weight: `empty_weight := baseweight(chest); // Get chest weight without contents`&lt;br /&gt;
- **[set_weight]** - Set total weight: `set_weight(item, 50); // Set total weight including contents`&lt;br /&gt;
- **[set_weight_base]** - Set base weight: `set_weight_base(item, 20); // Set empty weight of object`&lt;br /&gt;
- **[capacity]** - Carrying capacity: `max_cap := capacity(self); remaining := max_cap - weight(self); send(&amp;quot;Capacity: &amp;quot; + itoa(remaining) + &amp;quot; remaining&amp;quot;, self);`&lt;br /&gt;
- **[flags]** - Unit flags: `if (isset(self.flags, UNIT_FL_INVISIBLE)) { unset(self.flags, UNIT_FL_INVISIBLE); act(&amp;quot;You become visible!&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[idx]** - Unique ID: `guard_id := guard.idx; // Get unique identifier for tracking`&lt;br /&gt;
- **[key]** - Lock identifier: `if (item.key != &amp;quot;&amp;quot;) { sendtext(&amp;quot;Key required: &amp;quot; + item.key, self); }`&lt;br /&gt;
- **[loadcount]** - Instance tracking: `if (item.loadcount &amp;gt; 10) { destroy(item); log(&amp;quot;Too many instances loaded&amp;quot;); }`&lt;br /&gt;
- **[nameidx]** - Database name: `unit_id := item.nameidx + &amp;quot;@&amp;quot; + item.zoneidx; // Unique reference`&lt;br /&gt;
- **[manipulate]** - Object handling: `if (isset(item.manipulate, MANIPULATE_TAKE)) { sendtext(&amp;quot;You can take this item.&amp;quot;, self); }`&lt;br /&gt;
- **[minv]** - Wizard invisibility: `if (item.minv &amp;gt; self.level) { sendtext(&amp;quot;You can't see this item.&amp;quot;, self); }`&lt;br /&gt;
- **[names]** - Name list: `item_names := item.names; if (&amp;quot;sword&amp;quot; in item_names) { sendtext(&amp;quot;This is a sword.&amp;quot;, self); }`&lt;br /&gt;
- **[opendiff]** - Lock difficulty: `if (chest.opendiff &amp;gt; 20) { sendtext(&amp;quot;This chest has a very difficult lock.&amp;quot;, self); }`&lt;br /&gt;
- **[openflags]** - Open/lock state: `if (isset(door.openflags, EX_LOCKED)) { sendtext(&amp;quot;The door is locked.&amp;quot;, self); }`&lt;br /&gt;
- **[zone]** - Zone name: `zone_name := item.zone; sendtext(&amp;quot;This item belongs to zone: &amp;quot; + zone_name, self); }`&lt;br /&gt;
&lt;br /&gt;
### Object Fields&lt;br /&gt;
- **[value]** - Economics: `weapon_damage := weapon.value[1]; // Get damage from weapon value array`&lt;br /&gt;
- **[cost]** - Economics: `obj.cost := 1000; obj.rent := 10;`&lt;br /&gt;
- **[rent]** - Economics: `obj.cost := 1000; obj.rent := 10;`&lt;br /&gt;
- **[objectflags]** - Classification: `if (isset(item.objectflags, OBJ_MAGIC)) { act(&amp;quot;$1n glows with magic!&amp;quot;, A_ALWAYS, item, null, null, TO_ROOM); }`&lt;br /&gt;
- **[objecttype]** - Classification: `if (obj.flags &amp;amp; OBJ_FL_MAGIC) { /* magic item */ }`&lt;br /&gt;
&lt;br /&gt;
### Room Fields&lt;br /&gt;
- **[roomflags]** - Room properties: `if (isset(my_room.roomflags, ROOM_FL_DARK)) { sendtext(&amp;quot;This room is dark.&amp;quot;, self); }`&lt;br /&gt;
- **[exit_to]** - Room exits: `if (room.exit_to[NORTH] != null) { sendtext(&amp;quot;There is an exit to the north.&amp;quot;, self); }`&lt;br /&gt;
- **[exit_names]** - Room exits: `names := room.exit_names[NORTH]; if (length(names) &amp;gt; 0) { act(&amp;quot;Exit: &amp;quot; + names.[0], A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[mapx]** - Coordinates: `if (room.mapx != -1 and room.mapy != -1) { act(&amp;quot;Room coordinates: X=$2d, Y=$3d&amp;quot;, A_ALWAYS, self, room.mapx, room.mapy, TO_CHAR); }`&lt;br /&gt;
- **[mapy]** - Coordinates: `distance := (room2.mapx - room1.mapx) + (room2.mapy - room1.mapy);`&lt;br /&gt;
- **[exit_diff]** - Exit difficulty: `difficulty := room.exit_diff[NORTH]; if (skillcheck(SKI_CLIMB, ABIL_DEX, difficulty) &amp;gt; 0) { sendtext(&amp;quot;You climb successfully!&amp;quot;, self); }`&lt;br /&gt;
- **[exit_info]** - Exit flags: `if (isset(room.exit_info[NORTH], EX_CLOSED)) { unset(room.exit_info[NORTH], EX_CLOSED); act(&amp;quot;Door opens!&amp;quot;, A_ALWAYS, self, null, null, TO_ALL); }`&lt;br /&gt;
- **[exit_key]** - Exit key: `key_name := room.exit_key[NORTH]; if (key_name != &amp;quot;&amp;quot; and findsymbolic(key_name, FIND_UNIT_IN_ME)) { sendtext(&amp;quot;You have the key!&amp;quot;, self); }`&lt;br /&gt;
- **[movement]** - Terrain type: `if (room.movement == SECT_WATER_SAIL) { sendtext(&amp;quot;This area requires swimming or a boat!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Character Fields&lt;br /&gt;
- **[level]** - Character levels: `if (self.level &amp;gt;= 10) { sendtext(&amp;quot;You are experienced!&amp;quot;, self); }`&lt;br /&gt;
- **[vlevel]** - Character levels: `lvl := self.level; exp := self.exp;`&lt;br /&gt;
- **[exp]** - Experience points: `xp := self.exp; sendtext(&amp;quot;You have &amp;quot; + itoa(xp) + &amp;quot; experience points.&amp;quot;, self); }`&lt;br /&gt;
- **[experience]** - Modify experience: `experience(1000, player); // Give 1000 XP for quest completion`&lt;br /&gt;
- **[exptol]** - Experience to level: `if (self.exptol &amp;lt;= 0) { sendtext(&amp;quot;You can level up now!&amp;quot;, self); }`&lt;br /&gt;
- **[hp]** - Health: `hp_pct := (self.hp * 100) / self.max_hp; if (self.hp &amp;lt; 10) { /* low health */ }`&lt;br /&gt;
- **[max_hp]** - Health: `hp_pct := (self.hp * 100) / self.max_hp; target.hp := target.max_hp; // Full heal`&lt;br /&gt;
- **[position]** - States: `if (self.position == POSITION_FIGHTING) { /* in combat */ } else if (self.position == POSITION_SLEEPING) { /* asleep */ }`&lt;br /&gt;
- **[defaultpos]** - States: `if (self.position == POSITION_FIGHTING) { /* in combat */ }`&lt;br /&gt;
- **[fighting]** - Combat: `opp := self.fighting; if (opp != null) { sendtext(&amp;quot;Fighting &amp;quot; + opp.name, self); }`&lt;br /&gt;
- **[opponent]** - Combat: `opp := self.fighting;`&lt;br /&gt;
- **[master]** - Social relationships: `leader := self.master; if (leader != null) { act(&amp;quot;You are following $1n.&amp;quot;, A_ALWAYS, self, leader, null, TO_CHAR); }`&lt;br /&gt;
- **[follower]** - Social relationships: `first := self.follower; if (first != null) { act(&amp;quot;$1n is your first follower.&amp;quot;, A_ALWAYS, self, null, first, TO_CHAR); }`&lt;br /&gt;
- **[followercount]** - Social relationships: `count := self.followercount; if (count &amp;gt; 0) { sendtext(&amp;quot;You have &amp;quot; + itoa(count) + &amp;quot; followers.&amp;quot;, self); }`&lt;br /&gt;
- **[opponentcount]** - Combat opponents: `if (self.opponentcount &amp;gt; 1) { sendtext(&amp;quot;You are fighting multiple opponents!&amp;quot;, self); }`&lt;br /&gt;
- **[follow]** - Following control: `follow(prisoner, guard); // Make prisoner follow guard`&lt;br /&gt;
- **[abilities]** - Character attributes: `str := self.abilities[ABIL_STR]; dex := self.abilities[ABIL_DEX];`&lt;br /&gt;
- **[race]** - Character race: `if (self.race == RACE_ELF) { sendtext(&amp;quot;You are an elf!&amp;quot;, self); }`&lt;br /&gt;
- **[sex]** - Character gender: `if (activator.sex == SEX_MALE) { sendtext(&amp;quot;Greetings, sir!&amp;quot;, activator); }`&lt;br /&gt;
- **[speed]** - Combat speed: `if (self.speed &amp;gt; target.speed) { sendtext(&amp;quot;You strike first!&amp;quot;, self); }`&lt;br /&gt;
- **[ability_points]** - Available points: `points := self.ability_points; if (points &amp;gt;= 5) { /* can train */ }`&lt;br /&gt;
- **[ability_costs]** - Training costs: `cost := self.ability_costs[ABIL_STR]; if (money &amp;gt;= cost) { /* can afford training */ }`&lt;br /&gt;
- **[ability_levels]** - Training requirements: `required := self.ability_levels[ABIL_STR]; if (level &amp;gt;= required) { /* can train */ }`&lt;br /&gt;
- **[skill_points]** - Available skill points: `points := self.skill_points; if (points &amp;gt;= 10) { sendtext(&amp;quot;You can train skills!&amp;quot;, self); }`&lt;br /&gt;
- **[skills]** - Skill system: `skill := self.skills.[SKI_BASH];`&lt;br /&gt;
- **[skill_costs]** - Skill training costs: `cost := self.skill_costs[SKI_SWORD]; if (self.exp &amp;gt;= cost) { sendtext(&amp;quot;Can afford skill!&amp;quot;, self); }`&lt;br /&gt;
- **[skill_levels]** - Current skill levels: `level := self.skill_levels[SKI_SWORD]; sendtext(&amp;quot;Sword skill: &amp;quot; + itoa(level), self);`&lt;br /&gt;
- **[spells]** - Magic system: `spell := self.spells.[SPL_FIREBALL];`&lt;br /&gt;
- **[spell_costs]** - Spell learning costs: `cost := self.spell_costs[SPL_FIREBALL]; if (self.exp &amp;gt;= cost) { sendtext(&amp;quot;Can afford spell!&amp;quot;, self); }`&lt;br /&gt;
- **[spell_levels]** - Current spell levels: `level := self.spell_levels[SPL_FIREBALL]; sendtext(&amp;quot;Fireball level: &amp;quot; + itoa(level), self); }`&lt;br /&gt;
- **[alignment]** - Moral standing: `align := alignment(self); if (align &amp;lt; -500) { send(&amp;quot;You are evil!&amp;quot;, self); }`&lt;br /&gt;
- **[birth]** - Character creation: `age_days := (realtime - birth(self)) / 86400; send(&amp;quot;You are &amp;quot; + itoa(age_days) + &amp;quot; days old.&amp;quot;, self); }`&lt;br /&gt;
- **[drunk]** - Character state: `if (self.drunk &amp;gt; 10) { sendtext(&amp;quot;You are drunk!&amp;quot;, self); }`&lt;br /&gt;
- **[full]** - Hunger level: `if (self.full &amp;gt; 20) { sendtext(&amp;quot;You are very hungry.&amp;quot;, self); } else if (self.full &amp;lt; 5) { sendtext(&amp;quot;You feel quite full.&amp;quot;, self); }`&lt;br /&gt;
- **[thirst]** - Thirst level: `if (self.thirst &amp;lt; 5) { sendtext(&amp;quot;You are extremely thirsty!&amp;quot;, self); } else { self.thirst := 24; // Fully quench thirst }`&lt;br /&gt;
- **[endurance]** - Physical stamina: `if (self.endurance &amp;lt; 2) { sendtext(&amp;quot;You are exhausted!&amp;quot;, self); } else { self.endurance := self.endurance - 1; }`&lt;br /&gt;
- **[max_endurance]** - Maximum stamina: `end_pct := (self.endurance * 100) / self.max_endurance; sendtext(&amp;quot;Endurance: &amp;quot; + itoa(end_pct) + &amp;quot;%&amp;quot;, self); }`&lt;br /&gt;
- **[mana]** - Magic points: `if (self.mana &amp;lt; 50) { sendtext(&amp;quot;Not enough mana!&amp;quot;, self); } else { self.mana := self.mana - 50; }`&lt;br /&gt;
- **[max_mana]** - Maximum magic: `mana_pct := (self.mana * 100) / self.max_mana; sendtext(&amp;quot;Mana: &amp;quot; + itoa(mana_pct) + &amp;quot;%&amp;quot;, self); }`&lt;br /&gt;
- **[charflags]** - Character flags: `if (isset(activator.charflags, CHAR_OUTLAW)) { send(&amp;quot;You are an outlaw!&amp;quot;, activator); }`&lt;br /&gt;
- **[crimes]** - Criminal record: `if (activator.crimes &amp;gt; 0) { send(&amp;quot;You have &amp;quot; + itoa(activator.crimes) + &amp;quot; crimes on record.&amp;quot;, activator); }`&lt;br /&gt;
- **[height]** - Physical size: `height_diff := pc.height - armor.height; // Check size compatibility`&lt;br /&gt;
- **[hometown]** - Player origin: `link(player, findroom(player.hometown)); // Send player home`&lt;br /&gt;
- **[lifespan]** - Maximum age: `if (age &amp;gt; self.lifespan) { sendtext(&amp;quot;You have exceeded your lifespan!&amp;quot;, self); }`&lt;br /&gt;
- **[natural_armour]** - Base armor: `if (npc.natural_armour &amp;gt; 50) { sendtext(&amp;quot;This NPC has heavy natural armor.&amp;quot;, self); }`&lt;br /&gt;
- **[position_update]** - Update position: `target.hp := target.hp - damage; position_update(target); // Update after HP change`&lt;br /&gt;
- **[reset_level]** - Reset to level 1: `reset_level(player); // Reset character to starting level`&lt;br /&gt;
- **[reset_race]** - Reset race attributes: `reset_race(player); // Reset weight, height, age, lifespan, training costs`&lt;br /&gt;
- **[reset_vlevel]** - Reset virtual level: `reset_vlevel(player); // Reset virtual level to 1`&lt;br /&gt;
- **[weapon_costs]** - Weapon training costs: `cost := self.weapon_costs[WPN_SWORD]; if (money &amp;gt;= cost) { sendtext(&amp;quot;Can afford sword training!&amp;quot;, self); }`&lt;br /&gt;
- **[weapon_levels]** - Weapon skill levels: `level := self.weapon_levels[WPN_SWORD]; sendtext(&amp;quot;Sword skill level: &amp;quot; + itoa(level), self); }`&lt;br /&gt;
- **[weapons]** - Weapon skills: `skill := self.weapons[WPN_SWORD]; if (skill &amp;gt; 0) { sendtext(&amp;quot;You know sword fighting!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
#### PC fields&lt;br /&gt;
- **[profession]** - PC properties: `if (activator.profession == PROFESSION_THIEF) { sendtext(&amp;quot;Welcome, shadow walker!&amp;quot;, activator); }`&lt;br /&gt;
- **[guild]** - PC properties: `if (activator.guild == &amp;quot;thief&amp;quot;) { sendtext(&amp;quot;Welcome, brother of the shadows!&amp;quot;, activator); }`&lt;br /&gt;
- **[pcflags]** - Player flags: `if (isset(self.pcflags, PC_PK_RELAXED)) { sendtext(&amp;quot;You are signed up for player killing.&amp;quot;, self); }`&lt;br /&gt;
- **[playtime]** - Time played: `hours_played := self.playtime / 3600; sendtext(&amp;quot;You have played for &amp;quot; + itoa(hours_played) + &amp;quot; hours.&amp;quot;, self); }`&lt;br /&gt;
- **[quests]** - Quest list: `found_quest := &amp;quot;dragon_slaying&amp;quot; in self.quests; if (found_quest) { sendtext(&amp;quot;You have the dragon quest!&amp;quot;, self); }`&lt;br /&gt;
- **[switched]** - Character control: `controlled := self.switched; if (controlled) { sendtext(&amp;quot;You are controlling: &amp;quot; + controlled.name, self); }`&lt;br /&gt;
&lt;br /&gt;
#### NPC fields&lt;br /&gt;
- **[npcflags]** - NPC properties: `npcflags(npc, npc.npcflags | NPC_AGGRESSIVE); // Make NPC aggressive`&lt;br /&gt;
&lt;br /&gt;
### String Processing&lt;br /&gt;
- **[length]** - Get string length: `l := length(&amp;quot;hello&amp;quot;); // == 5`&lt;br /&gt;
- **[in]** - String/list membership: `if (&amp;quot;fox&amp;quot; in &amp;quot;The quick brown fox&amp;quot;) { /* found substring */ }`&lt;br /&gt;
- **[left]** - Extract left characters: `l := left(&amp;quot;hello&amp;quot;, 2); // == &amp;quot;he&amp;quot;`&lt;br /&gt;
- **[right]** - Extract right characters: `r := right(&amp;quot;world.txt&amp;quot;, 3); // == &amp;quot;txt&amp;quot;`&lt;br /&gt;
- **[strcmp]** - String comparison: `if (strcmp(password, stored) == 0) { sendtext(&amp;quot;Access granted.&amp;quot;, self); }`&lt;br /&gt;
- **[replace]** - Replace text: `new := replace(&amp;quot;fox&amp;quot;, &amp;quot;cat&amp;quot;, &amp;quot;The quick brown fox jumps over the lazy dog.&amp;quot;);`&lt;br /&gt;
- **[getword]** - Extract first word: `s:=&amp;quot;hello sam&amp;quot;; w := getword(s); // w=&amp;quot;hello&amp;quot;, s=&amp;quot;sam&amp;quot;`&lt;br /&gt;
- **[toupper]** - Convert to uppercase: `shout := toupper(&amp;quot;help!&amp;quot;); // == &amp;quot;HELP!&amp;quot;`&lt;br /&gt;
- **[tolower]** - Convert to lowercase: `answer := tolower(argument); if (answer == &amp;quot;yes&amp;quot;) { sendtext(&amp;quot;Great!&amp;quot;, self); }`&lt;br /&gt;
- **[strncmp]** - Compare with length limit: `if (strncmp(&amp;quot;hello&amp;quot;, &amp;quot;help&amp;quot;, 3) == 0) { sendtext(&amp;quot;Strings match for first 3 chars.&amp;quot;, self); }`&lt;br /&gt;
- **[mid]** - Extract substring: `weapon_type := mid(&amp;quot;longsword +2 of fire&amp;quot;, 1, 9); // == &amp;quot;longsword&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
### Stringlist Processing&lt;br /&gt;
- **[addstring]** - Add to list: `mylist := addstring(mylist, &amp;quot;new_item&amp;quot;); // Add item to list`&lt;br /&gt;
- **[substring]** - Remove from stringlist: `sl:={&amp;quot;hello&amp;quot;,&amp;quot;world&amp;quot;}; substring(sl, &amp;quot;world&amp;quot;) // sl now only contains &amp;quot;hello&amp;quot;`&lt;br /&gt;
- **[in]** - Stringlist membership: `if (&amp;quot;fox&amp;quot; in {&amp;quot;hello&amp;quot;, &amp;quot;fox&amp;quot;}) { /* found substring */ }`&lt;br /&gt;
- **[split]** - Split into stringlist: `words := split(&amp;quot;hello world this is a test&amp;quot;, &amp;quot; &amp;quot;);`&lt;br /&gt;
- **[getwords]** - Get stringlist: `sl := getwords(&amp;quot;hello world&amp;quot;); // sl is {&amp;quot;hello&amp;quot;, &amp;quot;world&amp;quot;}, original preserved`&lt;br /&gt;
&lt;br /&gt;
### Extra Description Functions&lt;br /&gt;
- **[addextra]** - Add descriptions: `addextra(item, 0, &amp;quot;A finely crafted sword with ancient runes.&amp;quot;); // Add main description`&lt;br /&gt;
- **[delstr]** - Delete string files: `if (delstr(&amp;quot;news.txt&amp;quot;)) { sendtext(&amp;quot;News file deleted.&amp;quot;, self); }`&lt;br /&gt;
- **[extra]** - .extra field: `desc := item.extra.descr; // Get extra description text`&lt;br /&gt;
- **[extraptr]** - Extra description pointer: `ex := self.extra; if (ex != null) { sendtext(&amp;quot;Found: &amp;quot; + ex.descr, self); }`&lt;br /&gt;
- **[loadstr]** - File operations: `result := loadstr(&amp;quot;news.txt&amp;quot;, content); if (result &amp;gt; 0) { sendtext(content, self); }`&lt;br /&gt;
- **[savestr]** - File operations: `result := savestr(&amp;quot;news.txt&amp;quot;, message, &amp;quot;w&amp;quot;); if (result &amp;gt; 0) { sendtext(&amp;quot;News saved!&amp;quot;, self); }`&lt;br /&gt;
- **[subextra]** - Remove extra descriptions: `subextra(item.extra, &amp;quot;quest_marker&amp;quot;); // Remove quest marker from item`&lt;br /&gt;
- **[vals]** - Extra values: `total := extra.vals.[0] + extra.vals.[1]; // Sum numeric values from extra description`&lt;br /&gt;
&lt;br /&gt;
**⚠️ Critical Notes:**&lt;br /&gt;
- Stringlists use dot notation: `words.[0]` NOT `words[0]`&lt;br /&gt;
- Convert integers for concatenation: `&amp;quot;Value: &amp;quot; + itoa(num)`&lt;br /&gt;
- substring() removes from stringlists, doesn't extract substrings&lt;br /&gt;
&lt;br /&gt;
## 💬 **Communication System**&lt;br /&gt;
&lt;br /&gt;
### Communication Functions&lt;br /&gt;
- **[sendtext]** - Basic messaging: `sendtext(&amp;quot;Hello, &amp;quot; + player_name + &amp;quot;!&amp;quot;, target); // Send formatted text to specific player`&lt;br /&gt;
- **[pagestring]** - Paginated output: `pagestring(&amp;quot;a very long string will be paged...&amp;quot;, self);`&lt;br /&gt;
- **[prompt]** - User interface: `self.prompt := &amp;quot;[%n%h/%Hhp %m/%M]&amp;gt; &amp;quot;; // Set custom prompt with health/mana display`&lt;br /&gt;
- **[act]** - Message formatting: `act(&amp;quot;You hit $3n for $2d damage!&amp;quot;, A_ALWAYS, self, null, victim, damage, TO_CHAR);`&lt;br /&gt;
- **[sact]** - String formatting: `desc := sact(&amp;quot;$1n is standing here.&amp;quot;, A_SOMEONE, target, null, null, TO_CHAR); // Format message as string`&lt;br /&gt;
- **[textformat]** - Format text: `formatted := textformat(&amp;quot;&amp;amp;nHello &amp;amp;y&amp;quot; + self.name + &amp;quot;&amp;amp;nWelcome!&amp;quot;); // Format with escape codes`&lt;br /&gt;
&lt;br /&gt;
## ⚔️ **Combat System**&lt;br /&gt;
&lt;br /&gt;
### Combat Functions&lt;br /&gt;
- **[set_fighting]** - Set combat: `set_fighting(self, intruder); // Start fighting intruder`&lt;br /&gt;
- **[stop_fighting]** - Stop combat: `stop_fighting(self, null); // Stop all combat`&lt;br /&gt;
- **[attack_type]** - Combat data: `current_attack := self.attack_type; sendtext(&amp;quot;Your current attack type is: &amp;quot; + weapon_name(current_attack), self);`&lt;br /&gt;
- **[weapon_info]** - Combat data: `wpn_info := weapon_info(WPN_SWORD); if (wpn_info.[0] == 2) { sendtext(&amp;quot;Two-handed weapon&amp;quot;, self); }`&lt;br /&gt;
- **[weapon_name]** - Combat data: `name := weapon_name(WPN_SWORD); sendtext(&amp;quot;Weapon type: &amp;quot; + name, self);`&lt;br /&gt;
- **[meleeattack]** - Attack actions: `damage := meleeattack(self, victim, 0, 0, TRUE); if (damage &amp;gt; 0) { act(&amp;quot;You hit $1n for $2d damage!&amp;quot;, A_ALWAYS, self, victim, damage, TO_CHAR); }`&lt;br /&gt;
- **[attack_spell]** - Attack actions: `damage := attack_spell(SPL_FIREBALL, caster, target, 0, &amp;quot;&amp;quot;); if (damage &amp;gt; 0) { act(&amp;quot;Your fireball deals &amp;quot; + itoa(damage) + &amp;quot; damage!&amp;quot;, A_ALWAYS, caster, null, target, damage, TO_CHAR); }`&lt;br /&gt;
- **[cast_spell]** - Spell casting: `damage := cast_spell(SPL_FIREBALL, self, self, target, 0, &amp;quot;&amp;quot;); if (damage &amp;gt; 0) { send(&amp;quot;Fireball deals &amp;quot; + itoa(damage) + &amp;quot; damage!&amp;quot;, self); }`&lt;br /&gt;
- **[meleedamage]** - Combat calculations: `damage := meleedamage(attacker, 50); // Calculate melee damage with base 50`&lt;br /&gt;
- **[defensive]** - Combat calculations: `defense_bonus := defender.defensive - attacker.defensive; if (defense_bonus &amp;gt; 50) { act(&amp;quot;Superior defense!&amp;quot;, A_ALWAYS, defender, null, null, TO_CHAR); }`&lt;br /&gt;
- **[offensive]** - Combat calculations: `off_bonus := target.offensive - attacker.offensive; if (off_bonus &amp;gt; 20) { act(&amp;quot;Significant offensive advantage!&amp;quot;, A_ALWAYS, attacker, null, null, TO_CHAR); }`&lt;br /&gt;
- **[change_speed]** - Combat timing: `change_speed(target, 12); // Delay target's next combat action by 12 pulses`&lt;br /&gt;
&lt;br /&gt;
## ✨ **Affects &amp;amp; Magic System**&lt;br /&gt;
&lt;br /&gt;
### Affect Functions&lt;br /&gt;
- **[addaff]** - Add affects: `addaff(player, ID_SANCTUARY, -1, 0, 0, 0, 0, 0, APF_DURATION | APF_FIRST, 0); // Permanent sanctuary`&lt;br /&gt;
- **[isaff]** - Check affects: `if (isaff(player, ID_BLIND)) { send(&amp;quot;You are blind!&amp;quot;, player); }`&lt;br /&gt;
- **[getaffects]** - Get all affects: `affects := getaffects(player); // Get list of all active affects`&lt;br /&gt;
- **[subaff]** - Remove affects: `subaff(player, ID_BLIND); // Remove blindness affect from player`&lt;br /&gt;
&lt;br /&gt;
## 💰 **Economic System**&lt;br /&gt;
&lt;br /&gt;
### Money Management&lt;br /&gt;
- **[purse]** - Character money: `gold := purse(player, GOLD_PIECE); if (gold &amp;gt;= 100) { sendtext(&amp;quot;You have enough gold!&amp;quot;, player); }`&lt;br /&gt;
- **[transfermoney]** - Money operations: `success := transfermoney(buyer, seller, 1000); // Transfer 1000 coins`&lt;br /&gt;
- **[moneystring]** - Money operations: `price := moneystring(2500, 1); // &amp;quot;25 gold pieces&amp;quot; or &amp;quot;25 gp&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
## ⏰ **Time &amp;amp; Calendar**&lt;br /&gt;
&lt;br /&gt;
### Time Functions&lt;br /&gt;
- **[mudhour]** - Game time: `hour := mudhour(); if (hour &amp;gt;= 6 and hour &amp;lt; 18) { sendtext(&amp;quot;Shop is open!&amp;quot;, self); }`&lt;br /&gt;
- **[mudday]** - Game time: `h := mudhour(); d := mudday(); m := mudmonth(); y := mudyear();`&lt;br /&gt;
- **[mudmonth]** - Game time: `h := mudhour(); d := mudday(); m := mudmonth(); y := mudyear();`&lt;br /&gt;
- **[mudyear]** - Game time: `h := mudhour(); d := mudday(); m := mudmonth(); y := mudyear();`&lt;br /&gt;
- **[asctime]** - Format time string: `time_str := asctime(); // &amp;quot;Mon Dec  5 12:34:56 2025&amp;quot;`&lt;br /&gt;
- **[realtime]** - Real time: `start_time := realtime(); // Record start time in seconds`&lt;br /&gt;
- **[weather]** - Weather conditions: `if (weather == SKY_CLOUDLESS) { sendtext(&amp;quot;Clear skies today!&amp;quot;, self); }`&lt;br /&gt;
- **[wait]** - Time control: `wait(SFB_CMD, command(&amp;quot;hello&amp;quot;)); // Wait for &amp;quot;hello&amp;quot; command`&lt;br /&gt;
- **[sleep]** - Sleep control: `sleep; // Put unit to sleep`&lt;br /&gt;
&lt;br /&gt;
## 🛠️ **Utility Functions**&lt;br /&gt;
&lt;br /&gt;
### Mathematics&lt;br /&gt;
- **[rnd]** - Random number: `num := rnd(1, 100); // Random 1-100`&lt;br /&gt;
- **[openroll]** - Open roll: `roll := openroll(100, 5); // Open-ended 1-100 roll with 5% continuation chance`&lt;br /&gt;
- **[max]** - Maximum: `result := max(a, b); // Larger of two numbers`&lt;br /&gt;
- **[min]** - Minimum: `result := min(a, b); // Smaller of two numbers`&lt;br /&gt;
- **[skill_name]** - Get skill name: `name := skill_name(SKI_SWORD); sendtext(&amp;quot;Skill: &amp;quot; + name, self);`&lt;br /&gt;
- **[spellindex]** - Find spell index: `idx := spellindex(&amp;quot;fireball&amp;quot;); if (idx != -1) { cast_spell(idx, self, self, target, 0, &amp;quot;&amp;quot;); }`&lt;br /&gt;
- **[spellinfo]** - Get spell details: `name := spellinfo(idx, realm, sphere, mana, off, resist, med, targ); sendtext(&amp;quot;Spell: &amp;quot; + name + &amp;quot; (Mana: &amp;quot; + itoa(mana) + &amp;quot;)&amp;quot;, self); }`&lt;br /&gt;
- **[strdir]** - List DIL files: `files := strdir(&amp;quot;spell_*&amp;quot;); foreach (file in files) { sendtext(&amp;quot;Found: &amp;quot; + file + &amp;quot;.dil&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### System Utilities&lt;br /&gt;
- **[log]** - Logging: `log(&amp;quot;Player &amp;quot; + self.name + &amp;quot; completed quest at &amp;quot; + asctime());`&lt;br /&gt;
- **[flog]** - File logging: `flog(&amp;quot;quests.log&amp;quot;, self.name + &amp;quot; completed quest: &amp;quot; + quest_name, &amp;quot;a&amp;quot;);`&lt;br /&gt;
- **[logcrime]** - Crime logging: `logcrime(thief, victim, CRIME_STEALING);`&lt;br /&gt;
- **[info]** - Player info: `email_expd := &amp;quot;$email&amp;quot; in pc.info; if (email_expd != null) email := email_expd.descr;`&lt;br /&gt;
- **[hasfunc]** - Function check: `if (item.hasfunc == 1) { act(&amp;quot;$1n has special powers.&amp;quot;, A_ALWAYS, item, null, null, TO_ROOM); }`&lt;br /&gt;
- **[access]** - Access control: `if (access(player, restricted_zone) &amp;gt;= 3) { sendtext(&amp;quot;Access granted!&amp;quot;, player); }`&lt;br /&gt;
- **[reboot]** - System restart: `act(&amp;quot;Rebooting MUD now...&amp;quot;, A_ALWAYS, self, null, null, TO_ALL); reboot(0);`&lt;br /&gt;
- **[dispatch]** - External messaging: `dispatch(&amp;quot;discord msg #bugs @&amp;quot; + self.name + &amp;quot; bug report: &amp;quot; + report_text); // Send to external dispatcher`&lt;br /&gt;
- **[gamestate]** - Player state: `gamestate(player, GS_MENU); // Put player in menu mode`&lt;br /&gt;
- **[getcmd]** - Command lookup: `cmd := getcmd(&amp;quot;say&amp;quot;); if (cmd) { sendtext(&amp;quot;Command level: &amp;quot; + itoa(cmd.level), self); }`&lt;br /&gt;
- **[getinteger]** - System values: `mana_reg := getinteger(DIL_GINT_MANAREG, player, 0); // Get mana regen rate`&lt;br /&gt;
- **[loglevel]** - Command logging: `cmd := getcommand(&amp;quot;kick&amp;quot;); if (cmd.loglevel &amp;gt; 0) { sendtext(&amp;quot;Command logs at level &amp;quot; + cmd.loglevel, self); }`&lt;br /&gt;
&lt;br /&gt;
## 📋 **Unit Operations**&lt;br /&gt;
&lt;br /&gt;
### Finding &amp;amp; Managing Units&lt;br /&gt;
- **[findunit]** - Unit search: `target := findunit(self, &amp;quot;sword&amp;quot;, FIND_UNIT_INVEN, null); // Find sword in inventory`&lt;br /&gt;
- **[findsymbolic]** - Unit search: `target := findsymbolic(&amp;quot;sword@midgaard&amp;quot;); if (target != null) { act(&amp;quot;Found: $1n&amp;quot;, A_ALWAYS, self, target, null, TO_CHAR); }`&lt;br /&gt;
- **[findrndunit]** - Unit search: `random_pc := findrndunit(self, FIND_UNIT_ZONE, UNIT_ST_PC); if (random_pc != null) { act(&amp;quot;Random player: $1n&amp;quot;, A_ALWAYS, self, random_pc, null, TO_CHAR); }`&lt;br /&gt;
- **[target]** - Symbolic search: `guard := target(&amp;quot;guard@midgaard&amp;quot;); if (guard) { sendtext(&amp;quot;Found guard: &amp;quot; + guard.name, self); }`&lt;br /&gt;
- **[symname]** - Get symbolic name: `sym := symname(target); if (sym != &amp;quot;&amp;quot;) { sendtext(&amp;quot;Symbolic name: &amp;quot; + sym, self); }`&lt;br /&gt;
- **[unitdir]** - File search: `files := unitdir(&amp;quot;corpse*&amp;quot;); // Find all corpse files in units directory`&lt;br /&gt;
- **[visible]** - Visibility check: `if (visible(self, target)) { sendtext(&amp;quot;You can see &amp;quot; + target.name, self); }`&lt;br /&gt;
- **[load]** - Unit creation: `item := load(&amp;quot;sword@midgaard&amp;quot;); if (item != null) { link(item, self); act(&amp;quot;Item created!&amp;quot;, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[delunit]** - Unit lifecycle: `if (delunit(&amp;quot;temp_guardian.unit&amp;quot;)) { act(&amp;quot;Temporary unit deleted.&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[destroy]** - Unit lifecycle: `item := findunit(self, &amp;quot;sword&amp;quot;, FIND_UNIT_IN_ME, null); if (item) { destroy(item); act(&amp;quot;Item destroyed!&amp;quot;, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[clone]** - Unit lifecycle: `copy := clone(original_item); if (copy != null) { link(copy, self); }`&lt;br /&gt;
- **[getfollower]** - Follower access: `follower := getfollower(leader, 0); // Get first follower`&lt;br /&gt;
- **[getopponent]** - Opponent access: `opponent := getopponent(character, 0); // Get first opponent`&lt;br /&gt;
&lt;br /&gt;
### Unit Validation&lt;br /&gt;
- **[can_carry]** - Carry validation: `result := can_carry(player, item, 1); if (result == 0) { /* can carry */ }`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### Finding &amp;amp; Managing Rooms&lt;br /&gt;
- **[findroom]** - Room operations: `room := findroom(&amp;quot;temple@midgaard&amp;quot;); if (room != null) { link(self, room); }`&lt;br /&gt;
- **[pathto]** - Room operations: `direction := pathto(self, target_room); // Get direction to target`&lt;br /&gt;
- **[setroomexit]** - Room connections: `setroomexit(room, DIR_NORTH, target_room); // Create north exit`&lt;br /&gt;
- **[lastroom]** - Previous location: `prev_room := lastroom(player); if (prev_room) { sendtext(&amp;quot;You came from: &amp;quot; + prev_room.name, player); }`&lt;br /&gt;
&lt;br /&gt;
### Object Management&lt;br /&gt;
- **[equip]** - Get Equipment: `weapon := equip(self, WEAR_HANDS); if (weapon != null) { sendtext(&amp;quot;Wielding: &amp;quot; + weapon.name, self); }`&lt;br /&gt;
- **[unequip]** - Remove Equipment: `weapon := equipment(self, WEAR_WIELD); if (weapon != null) { unequip(weapon); act(&amp;quot;You unequip &amp;quot; + weapon.title, A_ALWAYS, self, null, null, TO_CHAR); }` &lt;br /&gt;
- **[equipment]** - Check Equipment: `weapon := equipment(player, WEAR_WIELD); if (weapon != null) { send(&amp;quot;You are wielding &amp;quot; + weapon.name, player); } else { send(&amp;quot;You are not wielding anything.&amp;quot;, player); }`&lt;br /&gt;
- **[addequip]** - Add Equipment: `ring := load(&amp;quot;ring@midgaard&amp;quot;); if (ring != null) { addequip(ring, WEAR_FINGER_L); }`&lt;br /&gt;
- **[fits]** - Equipment validation: `reason := fits(player, armor, -1); if (reason != &amp;quot;&amp;quot;) { sendtext(&amp;quot;Armor doesn't fit: &amp;quot; + reason, player); }`&lt;br /&gt;
&lt;br /&gt;
### Movement &amp;amp; Linking &amp;amp; Lighting&lt;br /&gt;
- **[link]** - Unit positioning: `link(item, player); // Move item to player's inventory`&lt;br /&gt;
- **[remove]** - Inventory management: `remove(mylist, 2); // Remove element at index 2`&lt;br /&gt;
- **[insert]** - Inventory management: `insert(mylist, 1, &amp;quot;new_item&amp;quot;); // Insert at position 1`&lt;br /&gt;
- **[islight]** - Lighting: `if (islight(self)) { sendtext(&amp;quot;This item provides light.&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## 🎭 **DIL Program Management**&lt;br /&gt;
&lt;br /&gt;
### Program Structure&lt;br /&gt;
- **[dilbegin]** - Program definition: `dilbegin my_function(param : string);`&lt;br /&gt;
- **[var]** - Variable declaration: `dilbegin f(); var i : integer; name : string; code { /* program logic here */ } dilend`&lt;br /&gt;
- **[external]** - External function: `dilbegin f(); external integer my_func@function(u : unitptr); code { /* program logic here */ } dilend`&lt;br /&gt;
- **[code]** - Code block: `dilbegin f(); code { /* program logic here */ } dilend`&lt;br /&gt;
- **[dilend]** - Program definition: `} dilend`&lt;br /&gt;
&lt;br /&gt;
### Program Control&lt;br /&gt;
- **[priority]** - Execution control: `priority; // Block other DIL programs until nopriority called`&lt;br /&gt;
- **[nopriority]** - Execution control: `nopriority(); // Allow other DIL programs to execute again`&lt;br /&gt;
- **[waitnoop]** - Program flow: `waitnoop; // Temporarily release secure constraints for command execution`&lt;br /&gt;
&lt;br /&gt;
### Event Handling&lt;br /&gt;
- **[secure]** - Security control: `secure(victim, victim_fled); // Jump to victim_fled: if target disappears`&lt;br /&gt;
- **[unsecure]** - Security control: `secure(item, :item_lost); // Process item safely; unsecure(item); // Remove protection when done` &lt;br /&gt;
- **[on_activation]** - Event handlers: `on_activation((self.position &amp;lt;= POSITION_SLEEPING) or (self.position == POSITION_FIGHTING), skip); // Skip if asleep or fighting`&lt;br /&gt;
- **[interrupt]** - Program flow: `intr_id := interrupt(SFB_MSG, argument == &amp;quot;help&amp;quot;, help_handler); // Handle help requests`&lt;br /&gt;
- **[clear]** - Program flow: `clear(intridx); // Remove interrupt handler by index`&lt;br /&gt;
&lt;br /&gt;
### DIL Operations&lt;br /&gt;
- **[dilcall]** - Program management: `success := dilcall(&amp;quot;heal_spell&amp;quot;, self, 0, &amp;quot;minor&amp;quot;); // Call DIL template`&lt;br /&gt;
- **[dilfind]** - Program management: `if (dilfind(&amp;quot;quest_active&amp;quot;, player)) { sendtext(&amp;quot;Quest already in progress.&amp;quot;, self); }`&lt;br /&gt;
- **[dilcopy]** - Program management: `new_prog := dilcopy(&amp;quot;guard_ai&amp;quot;, self); // Create guard AI instance`&lt;br /&gt;
- **[dildestroy]** - Program management: `count := dildestroy(&amp;quot;temp_effect&amp;quot;, self); // Remove temporary effect`&lt;br /&gt;
- **[sendtoalldil]** - Inter-program communication: `sendtoalldil(&amp;quot;SYSTEM: Reboot in 5 minutes!&amp;quot;, &amp;quot;admin_*&amp;quot;); // Alert all admins`&lt;br /&gt;
- **[store]** - Inter-program communication: `store(chest, &amp;quot;chest_backup.&amp;quot; + chest.zoneidx, TRUE); // Save chest and contents`&lt;br /&gt;
- **[restore]** - Unit restoration: `item := restore(&amp;quot;saved_item&amp;quot;, null); if (item != null) { link(item, self); }`&lt;br /&gt;
&lt;br /&gt;
### DIL Message Functions&lt;br /&gt;
- **[send]** - Inter-program messaging: `send(&amp;quot;task_complete&amp;quot;); pause; send(&amp;quot;cleanup_ready&amp;quot;); // Send to waiting DIL programs with SFB_MSG`&lt;br /&gt;
- **[send_done]** - Completion messages: `send_done(&amp;quot;cast&amp;quot;, self, null, target, 1, &amp;quot;fireball&amp;quot;, null, 0); // Notify spell completion`&lt;br /&gt;
- **[send_pre]** - Preparation messages: `result := send_pre(&amp;quot;cast&amp;quot;, self, null, target, 1, &amp;quot;fireball&amp;quot;, null, 0); if (result == SFR_BLOCK) { sendtext(&amp;quot;Spell blocked!&amp;quot;, self); }`&lt;br /&gt;
- **[sendto]** - Basic messaging: `sendto(&amp;quot;The sword glows with ancient power.&amp;quot;, self); // Send to all DIL programs within a unit`&lt;br /&gt;
- **[sendtoall]** - Broadcast functions: `sendtoall(&amp;quot;SYSTEM SHUTDOWN IN 10 MINUTES!&amp;quot;, &amp;quot;sys_control&amp;quot;); // Send to all matching DIL programs globally`&lt;br /&gt;
- **[sendtoalldil]** - Broadcast functions: `sendtoall(&amp;quot;NEW SPELL AVAILABLE: fireball&amp;quot;, &amp;quot;spell_*&amp;quot;); // Send to specific DIL programs by pattern`&lt;br /&gt;
&lt;br /&gt;
### PC multi-line editing function&lt;br /&gt;
- **[beginedit]** - Start editing mode: `beginedit(self); wait(SFB_EDIT, self == activator); // Get edited text in argument`&lt;br /&gt;
- **[killedit]** - Force exit editing: `killedit(self); // Stop editing session immediately`&lt;br /&gt;
- **[editing]** - Check editing status: `if (self.editing) { sendtext(&amp;quot;Already editing!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Development Tools&lt;br /&gt;
- **[shell]** - Execute system command: `result := shell(&amp;quot;backup_script.sh&amp;quot;); // Returns 0 if thread created`&lt;br /&gt;
- **[exec]** - Execute a command: `exec(&amp;quot;say Hello there!&amp;quot;, target); // Force target char to speak`&lt;br /&gt;
&lt;br /&gt;
## 🌍 **World Management**&lt;br /&gt;
&lt;br /&gt;
### Zone management&lt;br /&gt;
- **[findzone]** - Zone operations: `zone := findzone(&amp;quot;midgaard&amp;quot;); if (zone != null) { sendtext(&amp;quot;Found zone: &amp;quot; + zone.name, self); }`&lt;br /&gt;
- **[zoneidx]** - Zone properties: `unit_id := self.zoneidx; // Returns &amp;quot;name@zone&amp;quot; format`&lt;br /&gt;
- **[loadlevel]** - Zone restrictions: `if (self.level &amp;lt; zone.loadlevel) { sendtext(&amp;quot;Zone requires level &amp;quot; + zone.loadlevel, self); }`&lt;br /&gt;
- **[resetmode]** - Zone properties: `mode := zone.resetmode; // Get zone reset mode (read-only)`&lt;br /&gt;
- **[resettime]** - Zone properties: `zone.resettime := 30; // Set reset interval to 30 minutes`&lt;br /&gt;
- **[zonereset]** - Zone resets: `zonereset(zone); // Reset all NPCs and objects in zone`&lt;br /&gt;
- **[help]** - Zone information: `target_zone := findzone(zone_name); help_text := target_zone.help; act(help_text, A_ALWAYS, self, null, null, TO_CHAR);`&lt;br /&gt;
- **[roomcount]** - Zone properties: `count := zone.roomcount; // Get number of rooms in zone`&lt;br /&gt;
- **[rooms]** - Zone properties: `room := zone.rooms; while (room) { sendtext(room.name, self); room := room.next; }`&lt;br /&gt;
- **[npcs]** - Zone properties: `npc := npcs(zone); while (npc) { sendtext(npc.name, self); npc := npc.next; }`&lt;br /&gt;
- **[npccount]** - Zone properties: `count := npccount(zone); // Get number of NPCs in zone`&lt;br /&gt;
- **[objs]** - Field Object operations: `zone := findzone(&amp;quot;midgaard&amp;quot;); first_obj := zone.objs; while (first_obj != null) { act(&amp;quot;Zone object: $1n&amp;quot;, A_ALWAYS, self, first_obj, null, TO_CHAR); first_obj := first_obj.next; }`&lt;br /&gt;
- **[objcount]** - Object operations: `zone := findzone(&amp;quot;midgaard&amp;quot;); count := zone.objcount; act(&amp;quot;Zone has $1d objects&amp;quot;, A_ALWAYS, self, count, null, TO_CHAR);`&lt;br /&gt;
- **[creators]** - Zone authors: `if (zone.creators) { foreach (name in zone.creators) { act(&amp;quot;Creator: &amp;quot; + name, self); } }`&lt;br /&gt;
- **[fname]** - Zone filename: `zone_file := zone.fname; sendtext(&amp;quot;Zone file: &amp;quot; + zone_file, self);`&lt;br /&gt;
- **[notes]** - Zone documentation: `zone.notes := &amp;quot;Administrative zone - restricted access&amp;quot;; // Set zone notes`&lt;br /&gt;
&lt;br /&gt;
### List management&lt;br /&gt;
- **[global_head]** - Inter-program communication: `first_unit := global_head(); // Get first unit in global list`&lt;br /&gt;
- **[room_head]** - Room operations: `room := room_head(); while (room) { sendtext(room.name, self); room := room.next; }`&lt;br /&gt;
- **[obj_head]** - Object operations: `first_obj := obj_head(); while (first_obj != null) { act(&amp;quot;Object: $1n&amp;quot;, A_ALWAYS, self, first_obj, null, TO_CHAR); first_obj := first_obj.next; }`&lt;br /&gt;
- **[pc_head]** - PC operations: &lt;br /&gt;
- **[npc_head]** - NPC operations: `npc := npc_head(); while (npc) { sendtext(npc.name, self); npc := npc.next; }`&lt;br /&gt;
- **[zone_head]** - Zone operations: `first_zone := zone_head(); // Get first zone in global list`&lt;br /&gt;
- **[zhead]** - Zone operations: `zone := zhead(); while (zone) { sendtext(zone.name, self); zone := zone.next; }`&lt;br /&gt;
- **[chead]** - Command operations: `cmd := chead(); while (cmd) { act(&amp;quot;Command: &amp;quot; + cmd.name, A_ALWAYS, self, null, null, TO_CHAR); cmd := cmd.next; }`&lt;br /&gt;
- **[command_head]** - Command list: `cmd := command_head(); while (cmd) { act(&amp;quot;Found: &amp;quot; + cmd.name, self); cmd := cmd.next; }`&lt;br /&gt;
- **[ghead]** - Global list: `unit := ghead(); while (unit) { sendtext(unit.name, self); unit := unit.gnext; }` &lt;br /&gt;
&lt;br /&gt;
#### List Operations&lt;br /&gt;
- **[next]** - Next element: `item := item.next; // Move to next item in list`&lt;br /&gt;
- **[gnext]** - Global next: `unit := unit.gnext; // Move to next unit in global list`&lt;br /&gt;
- **[gprevious]** - Previous element: `prev_unit := unit.gprevious; // Get previous unit in global list`&lt;br /&gt;
&lt;br /&gt;
## 🔐 **Security &amp;amp; Validation**&lt;br /&gt;
&lt;br /&gt;
### Security Functions&lt;br /&gt;
- **[check_password]** - Account management: `if (check_password(player, argument)) { send(&amp;quot;Password verified.&amp;quot;, player); } else { send(&amp;quot;Invalid password.&amp;quot;, player); }`&lt;br /&gt;
- **[set_password]** - Account management: `set_password(player, &amp;quot;newpass123&amp;quot;); // Change player password`&lt;br /&gt;
- **[delete_player]** - Account management: `if (isplayer(&amp;quot;troublemaker&amp;quot;)) { delete_player(&amp;quot;troublemaker&amp;quot;); }`&lt;br /&gt;
- **[access]** - Security control: `if (access(player, restricted_zone) &amp;gt;= 3) { sendtext(&amp;quot;Access granted!&amp;quot;, player); }`&lt;br /&gt;
- **[isplayer]** - Player validation: `if (not isplayer(player_name)) { sendtext(&amp;quot;Player not found.&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### God Functions&lt;br /&gt;
- **[switch]** - Character control: `switch(self, target); sendtext(&amp;quot;You have switched to &amp;quot; + target.name + &amp;quot;.&amp;quot;, self);`&lt;br /&gt;
&lt;br /&gt;
### Pay to Play functions (not in use)&lt;br /&gt;
- **[paycheck]** - Character money: `if (paycheck(shop_room, player)) { sendtext(&amp;quot;Access granted!&amp;quot;, player); }`&lt;br /&gt;
- **[acc_balance]** - Bank accounts: `balance := player.acc_balance; if (balance &amp;gt;= 10000) { sendtext(&amp;quot;You have $100+ in your account!&amp;quot;, player); }`&lt;br /&gt;
- **[acc_total]** - Bank accounts: `total_credit := player.acc_total; if (total_credit &amp;gt;= 50000) { sendtext(&amp;quot;Premium account!&amp;quot;, player); }`&lt;br /&gt;
- **[acc_modify]** - Bank accounts: `acc_modify(player, -5000); // Remove $50 from account`&lt;br /&gt;
- **[payonly]** - Payment status: `if (zone.payonly) { sendtext(&amp;quot;This zone requires payment to access.&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Color Functions (not in use)&lt;br /&gt;
- **[addcolor]** - Add colors: `addcolor(player, &amp;quot;&amp;amp;red&amp;quot;); // Add red to player's color palette`&lt;br /&gt;
- **[delcolor]** - Remove colors: `delcolor(player, &amp;quot;&amp;amp;red&amp;quot;); // Remove red from player's color palette`&lt;br /&gt;
- **[changecolor]** - Modify colors: `if (changecolor(player, &amp;quot;clan_color&amp;quot;, &amp;quot;&amp;amp;c+w&amp;amp;bn&amp;quot;)) { send(&amp;quot;Clan color updated!&amp;quot;, player); }`&lt;br /&gt;
- **[getcolor]** - Color processing: `processed := getcolor(&amp;quot;&amp;amp;brBold red text&amp;amp;n&amp;quot;); // Process color codes`&lt;br /&gt;
&lt;br /&gt;
## 🏷️ **Constants &amp;amp; Types** (vme/include/vme.h and vme/include/values.h)&lt;br /&gt;
&lt;br /&gt;
### SFB&lt;br /&gt;
## 🏷️ **Constants &amp;amp; Types** (vme/include/vme.h and vme/include/values.h)&lt;br /&gt;
These are #define constants from the source headers. Use them in DIL for flags, types, etc. (e.g., `if (self.type == UNIT_ST_PC)`). Values are numeric; descriptions are based on code comments/context.&lt;br /&gt;
&lt;br /&gt;
### State Function Bits (SFB_*)&lt;br /&gt;
Used in wait(), interrupt(), etc., for event triggers.&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| SFB_CMD  | Normal command trigger. |&lt;br /&gt;
| SFB_TICK | Tick-message trigger.   |&lt;br /&gt;
| SFB_DEAD | Death-message trigger. |&lt;br /&gt;
| SFB_COM  | Combat-event trigger. |&lt;br /&gt;
| SFB_MSG  | Message-event trigger. |&lt;br /&gt;
| SFB_SAVE | Save-event trigger. |&lt;br /&gt;
| SFB_DONE | Indicates something has been done. |&lt;br /&gt;
| SFB_ALL  | (SFB_CMD \| SFB_TICK \| SFB_DEAD \| SFB_COM \| SFB_MSG \| SFB_SAVE) | All common triggers. |&lt;br /&gt;
&lt;br /&gt;
### Unit Types (UNIT_ST_*)&lt;br /&gt;
For unit.type checks (e.g., in findunit()).&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| UNIT_ST_NPC | Non-player character. |&lt;br /&gt;
| UNIT_ST_PC | Player character. |&lt;br /&gt;
| UNIT_ST_ROOM | Room. |&lt;br /&gt;
| UNIT_ST_OBJ | Object. |&lt;br /&gt;
&lt;br /&gt;
### Positions (POSITION_*)&lt;br /&gt;
For char.position, defaultpos, etc.&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| POSITION_DEAD Dead (use corpse). |&lt;br /&gt;
| POSITION_MORTALLYW | Mortally wounded. |&lt;br /&gt;
| POSITION_INCAP | Incapacitated. |&lt;br /&gt;
| POSITION_STUNNED | Stunned. |&lt;br /&gt;
| POSITION_SLEEPING | Sleeping. |&lt;br /&gt;
| POSITION_RESTING | Resting. |&lt;br /&gt;
| POSITION_SITTING | Sitting. |&lt;br /&gt;
| POSITION_FIGHTING | Fighting (do not set manually). |&lt;br /&gt;
| POSITION_STANDING | Standing. |&lt;br /&gt;
&lt;br /&gt;
### Character Flags (CHAR_*)&lt;br /&gt;
For char.charflags.&lt;br /&gt;
&lt;br /&gt;
| Constant |  Description |&lt;br /&gt;
|----------|--------------|&lt;br /&gt;
| CHAR_PROTECTED | Protected by law system. |&lt;br /&gt;
| CHAR_LEGAL_TARGET | Internal (do not use). |&lt;br /&gt;
| CHAR_OUTLAW | Outlaw status (do not use). |&lt;br /&gt;
| CHAR_GROUP | In group (do not use). |&lt;br /&gt;
| CHAR_BLIND | Blinded. |&lt;br /&gt;
| CHAR_HIDE | Hidden. |&lt;br /&gt;
| CHAR_MUTE | Mute. |&lt;br /&gt;
| CHAR_SNEAK | Sneaking. |&lt;br /&gt;
| CHAR_DETECT_ALIGN | Detect alignment (PCs only). |&lt;br /&gt;
| CHAR_DETECT_INVISIBLE | See invisible. |&lt;br /&gt;
| CHAR_DETECT_MAGIC | Detect magic (PCs only). |&lt;br /&gt;
| CHAR_DETECT_POISON | Detect poison (PCs only). |&lt;br /&gt;
| CHAR_DETECT_UNDEAD | Detect undead (PCs only). |&lt;br /&gt;
| CHAR_DETECT_CURSE | Detect curse (PCs only). |&lt;br /&gt;
| CHAR_DETECT_LIFE | Detect life (PCs only). |&lt;br /&gt;
| CHAR_WIMPY | Wimpy mode (flee low HP). |&lt;br /&gt;
| CHAR_SELF_DEFENCE | Internal use (do not use). |&lt;br /&gt;
| CHAR_PEACEFUL | No auto-attack. |&lt;br /&gt;
| CHAR_KILL_SELF | Self-kill detection. |&lt;br /&gt;
&lt;br /&gt;
### Object Flags (OBJ_*)&lt;br /&gt;
For obj.objectflags.&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| OBJ_NO_UNEQUIP |Cannot unequip. |&lt;br /&gt;
| OBJ_TWO_HANDS | Requires two hands. |&lt;br /&gt;
| OBJ_NOCOVER | Doesn't cover body part. |&lt;br /&gt;
| OBJ_NO_DUAL | Cannot dual-wield. |&lt;br /&gt;
| OBJ_VEHICLE | Vehicle type (extended). |&lt;br /&gt;
&lt;br /&gt;
(Truncate for brevity; full list includes OBJ_MAGIC from snippets.)&lt;br /&gt;
&lt;br /&gt;
### Room Flags (ROOM_*)&lt;br /&gt;
For room.roomflags (e.g., UNIT_FL_INDOORS in zone).&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| UNIT_FL_INDOORS Indoors (no weather). |&lt;br /&gt;
| UNIT_FL_NO_WEATHER | No weather effects. |&lt;br /&gt;
| UNIT_FL_NO_MOB | No mobiles allowed. |&lt;br /&gt;
| ROOM_FL_DARK | Dark&lt;br /&gt;
&lt;br /&gt;
### Flags&lt;br /&gt;
- **[ROOM_*]** - Room flags&lt;br /&gt;
- **[CMD_*]** - Command flags&lt;br /&gt;
- **[SPL_*]** - Spell flags&lt;br /&gt;
- **[SKI_*]** - Skill flags&lt;br /&gt;
- **[ABIL_*]** - Ability flags&lt;br /&gt;
&lt;br /&gt;
### Zone Macros (vme/include/wmacros.h vme/include/monster.h)&lt;br /&gt;
Used in .zon files (e.g., for NPC/object defs). Not directly in DIL, but referenced.&lt;br /&gt;
Easy way to create all kind of standard objects or characters. &lt;br /&gt;
&lt;br /&gt;
| Macro | Expansion/Usage | Description |&lt;br /&gt;
|-------|-----------------|-------------|&lt;br /&gt;
| M_AVG_HUMAN(level, sex) | (Sets height, weight, etc. based on level/sex) | Average human NPC stats. |&lt;br /&gt;
| WEAPON_DEF(wpn_type, def_bonus, att_bonus) | (Sets value[0-4] for weapons) | Defines weapon type/damage. |&lt;br /&gt;
| BONUS_AVERAGE | 0 | Average bonus (use -5 to 5 for poor/excellent). |&lt;br /&gt;
| OUT_DARK_NON_NOON | (Sets outside_descr based on time) | Dark description except noon. |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## 🚨 **Critical Compilation Guidelines**&lt;br /&gt;
&lt;br /&gt;
### Reserved Keywords (⚠️ IMPORTANT)&lt;br /&gt;
The following words are **reserved** in DIL and **cannot be used as variable names**:&lt;br /&gt;
- `opponent` - **Function name, not variable** - use `opp`, `target_unit`, or `target` instead&lt;br /&gt;
- `for` - **Not supported** - use `while` loops instead&lt;br /&gt;
- Other reserved words may exist during compilation&lt;br /&gt;
&lt;br /&gt;
### Variable Naming Conventions&lt;br /&gt;
- **Maximum name length:** 16 characters for unit names&lt;br /&gt;
- **Use descriptive names:** `target_unit` instead of `target`&lt;br /&gt;
- **Use underscores:** `current_room` for readability&lt;br /&gt;
- **Avoid all reserved keywords** listed above&lt;br /&gt;
&lt;br /&gt;
# Common DIL Patterns and templates&lt;br /&gt;
These examples demonstrate common DIL idioms using the language features above. Use them as starting points for your scripts.&lt;br /&gt;
&lt;br /&gt;
- **Infinite Event Loop (NPC AI):**&lt;br /&gt;
```&lt;br /&gt;
  // Skip if NPC is busy&lt;br /&gt;
  on_activation((self.position &amp;lt;= POSITION_SLEEPING) or (self.position == POSITION_FIGHTING), skip);&lt;br /&gt;
:start:&lt;br /&gt;
  wait(SFB_CMD | SFB_MSG, activator.type == UNIT_ST_PC);  // Wait for any command or message from PC&lt;br /&gt;
  if (not visible(self, activator)) // We deal with players we can see&lt;br /&gt;
    goto start;&lt;br /&gt;
  u := activator;&lt;br /&gt;
  secure(u, start); // If pc disappears we jump to start&lt;br /&gt;
  // Handle event... &lt;br /&gt;
:cleanup:&lt;br /&gt;
  unsecure(u);&lt;br /&gt;
  goto start;&lt;br /&gt;
&lt;br /&gt;
- **Secure Target Handling (Prevent Null Pointers):**&lt;br /&gt;
  target := findunit(self, &amp;quot;playername&amp;quot;, FIND_UNIT_SURRO, UNIT_ST_PC);&lt;br /&gt;
  if (target != null) {&lt;br /&gt;
    secure(target, lost_target);&lt;br /&gt;
    // Safe operations on target...&lt;br /&gt;
  }&lt;br /&gt;
  unsecure(target);&lt;br /&gt;
:lost_target:&lt;br /&gt;
  log(&amp;quot;Target lost&amp;quot;);&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Random Decision Tree:**&lt;br /&gt;
```&lt;br /&gt;
chance := rnd(1, 100);&lt;br /&gt;
if (chance &amp;lt;= 30) {&lt;br /&gt;
  // Action 1&lt;br /&gt;
} else if (chance &amp;lt;= 70) {&lt;br /&gt;
  // Action 2&lt;br /&gt;
} else {&lt;br /&gt;
  // Action 3&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
- **Quest Flag Check/Update (Using Extra):**&lt;br /&gt;
if (&amp;quot;rabbit quest ongoing&amp;quot; in activator.quests) {&lt;br /&gt;
  sendtext(&amp;quot;Bring me that skin.&amp;quot;, activator);&lt;br /&gt;
} else if (&amp;quot;rabbit quest complete&amp;quot; in activator.quests) {&lt;br /&gt;
  sendtext(&amp;quot;Quest already complete!&amp;quot;, activator);&lt;br /&gt;
} else {&lt;br /&gt;
   addextra(pc.quests, {&amp;quot;rabbit quest ongoing&amp;quot;}, &amp;quot;kill the killer rabbit&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Coordinated NPC Movement and Event Triggering (Multi-NPC AI):**&lt;br /&gt;
```&lt;br /&gt;
  external&lt;br /&gt;
    integer walk_room@function (s:string,i:integer);  // Import pathfinding function&lt;br /&gt;
  var&lt;br /&gt;
    tf:integer;  // Temp for walk result&lt;br /&gt;
    target_room: string;  // Destination symbolic name&lt;br /&gt;
  code&lt;br /&gt;
  {&lt;br /&gt;
    // Skip if busy or invalid state&lt;br /&gt;
    on_activation((self.position &amp;lt;= POSITION_SLEEPING) or (self.position == POSITION_FIGHTING), skip);&lt;br /&gt;
:start:&lt;br /&gt;
    // Wait for trigger (e.g., message from another DIL)&lt;br /&gt;
    wait(SFB_MSG, argument == &amp;quot;raid_start&amp;quot;);&lt;br /&gt;
    // Move to target with pathfinding&lt;br /&gt;
    target_room := &amp;quot;cabin@haon_dor&amp;quot;;&lt;br /&gt;
    tf := walk_room@function(target_room, 4);  // 4 = speed/mode; adjust as needed&lt;br /&gt;
    if (tf == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
       // Perform action at destination&lt;br /&gt;
       exec(&amp;quot;emote raids the cabin!&amp;quot;, self);&lt;br /&gt;
       pause;&lt;br /&gt;
       // Signal completion to other NPCs/DILs&lt;br /&gt;
       sendto(&amp;quot;raid_complete&amp;quot;, findsymbolic(&amp;quot;orc_chief@haon_dor&amp;quot;));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Return or loop&lt;br /&gt;
    tf := FALSE;&lt;br /&gt;
    while (tf == FALSE)&lt;br /&gt;
      tf := walk_room@function(&amp;quot;orc_cave@haon_dor&amp;quot;, 4);&lt;br /&gt;
    goto start;  // Back to waiting loop&lt;br /&gt;
  }&lt;br /&gt;
  // The orc chief could send a message like this&lt;br /&gt;
  //    sendto(&amp;quot;raid_start&amp;quot;, findsymbolic(&amp;quot;orc1@somezone&amp;quot;));&lt;br /&gt;
```&lt;br /&gt;
- **Advanced pattern for handcuffing player**&lt;br /&gt;
```&lt;br /&gt;
dilbegin cuff_target(deputy : unitptr, targ : unitptr);&lt;br /&gt;
var&lt;br /&gt;
  cuffs : unitptr;&lt;br /&gt;
code {&lt;br /&gt;
  act(&amp;quot;You cuff $3n.&amp;quot;, A_SOMEONE, deputy, null, targ, TO_CHAR);&lt;br /&gt;
  follow(targ, deputy);  // Force target to follow&lt;br /&gt;
  unequip(equipment(targ, WEAR_WRIST_R));  // Remove existing wrist item&lt;br /&gt;
&lt;br /&gt;
  cuffs := load(&amp;quot;cuffs@midgaard&amp;quot;); // Now inside the deputy&lt;br /&gt;
  link(cuffs, targ);     // Move cuffs to target&lt;br /&gt;
  addequip(cuffs, WEAR_WRIST_R);  // Equip cuffs on the char it is .inside&lt;br /&gt;
  dilcopy(&amp;quot;cuffed@midgaard(&amp;quot;+self.name+&amp;quot;)&amp;quot;, targ);  // Apply restraint DIL to cuffs&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Handcuffs blocks all DILs**&lt;br /&gt;
```&lt;br /&gt;
// The person with this DIL can only execute a few commands&lt;br /&gt;
// fnpri is the execution priority of the DIL (the order in which they are executed on events)&lt;br /&gt;
// unique means there can not be a duplicate of this running, only one copy per unit&lt;br /&gt;
// aware means events from the unit itself also trigger events (normally excluded)&lt;br /&gt;
dilbegin fnpri(FN_PRI_RESCUE-2) aware unique cuffed2(depname : string);&lt;br /&gt;
var&lt;br /&gt;
   i      : integer;&lt;br /&gt;
   u      : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   interrupt(SFB_COM, activator == self, broken); // If in combat, stop this&lt;br /&gt;
&lt;br /&gt;
   :loop:&lt;br /&gt;
   wait(SFB_CMD, TRUE);&lt;br /&gt;
&lt;br /&gt;
   :postloop:&lt;br /&gt;
   if (activator == self.master)&lt;br /&gt;
   {&lt;br /&gt;
      if (activator.position &amp;lt; POSITION_STANDING)&lt;br /&gt;
        goto loop;&lt;br /&gt;
&lt;br /&gt;
      /* Do this trickery to allow the cuffed person to follow! */&lt;br /&gt;
&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;
         wait(SFB_CMD, TRUE);&lt;br /&gt;
         if (activator == self)&lt;br /&gt;
         {&lt;br /&gt;
            if (command(&amp;quot;north&amp;quot;) or command(&amp;quot;east&amp;quot;) or&lt;br /&gt;
               command(&amp;quot;south&amp;quot;) or command(&amp;quot;west&amp;quot;) or&lt;br /&gt;
               command(&amp;quot;up&amp;quot;) or command(&amp;quot;down&amp;quot;))&lt;br /&gt;
            {&lt;br /&gt;
               goto loop;&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         goto postloop;&lt;br /&gt;
      }&lt;br /&gt;
      goto loop;&lt;br /&gt;
   }&lt;br /&gt;
   else if (activator == self)&lt;br /&gt;
   {&lt;br /&gt;
      if (command(&amp;quot;look&amp;quot;) or command(&amp;quot;say&amp;quot;) or&lt;br /&gt;
          command(&amp;quot;ask&amp;quot;) or command(&amp;quot;tell&amp;quot;))&lt;br /&gt;
        goto loop;&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         block; // Block execution of all other commands&lt;br /&gt;
         act(depname + &amp;quot; prevents you from removing the hand cuffs.&amp;quot;,&lt;br /&gt;
            A_ALWAYS, self, null, null, TO_CHAR);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   goto loop;&lt;br /&gt;
&lt;br /&gt;
   :broken:&lt;br /&gt;
   i := dildestroy(&amp;quot;cuffed@midgaard&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
// Make sure the handcuffs blocks execution of other DILs.&lt;br /&gt;
// So it's one worse priority (-1) than &amp;quot;cuffed2&amp;quot; (-2).&lt;br /&gt;
//  meaning cuffed2 will run, and cuffed will block.&lt;br /&gt;
//&lt;br /&gt;
dilbegin fnpri(FN_PRI_RESCUE-1) aware unique cuffed(depname : string);&lt;br /&gt;
var&lt;br /&gt;
   cuffs  : unitptr;&lt;br /&gt;
   deputy : unitptr;&lt;br /&gt;
   i      : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   cuffs := equipment(self, WEAR_WRIST_R);&lt;br /&gt;
   secure(cuffs, broken);&lt;br /&gt;
&lt;br /&gt;
   deputy := self.master;&lt;br /&gt;
   secure(deputy, broken);&lt;br /&gt;
&lt;br /&gt;
   if ((deputy == null) or (cuffs == null))&lt;br /&gt;
   {&lt;br /&gt;
      log(&amp;quot;Cuffed lost either deputy or cuffs&amp;quot;);&lt;br /&gt;
      goto broken;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   heartbeat := PULSE_SEC * 1;&lt;br /&gt;
&lt;br /&gt;
   :loop:&lt;br /&gt;
   if (cuffs.equip != WEAR_WRIST_R)&lt;br /&gt;
     goto broken;&lt;br /&gt;
   priority; // Block all DILs running with a worse priority on this unit&lt;br /&gt;
   wait(SFB_TICK|SFB_CMD, activator == self);&lt;br /&gt;
   goto loop;&lt;br /&gt;
&lt;br /&gt;
   :broken:&lt;br /&gt;
   i := dildestroy(&amp;quot;cuffed2@midgaard&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- **Guard routine utilizing vme/zone/quest.zon DIL functions**&lt;br /&gt;
```&lt;br /&gt;
dilbegin guardroutine(guardloc: string, dayguard: integer);&lt;br /&gt;
external DailyRoutine@quests(sl : stringlist, sarg2 : string);&lt;br /&gt;
var sch: intlist;&lt;br /&gt;
code {&lt;br /&gt;
  if (dayguard) sch := {5, 18};  // Day schedule&lt;br /&gt;
  while (TRUE) {&lt;br /&gt;
    pause;&lt;br /&gt;
    if (mudhour == sch.[0]) {  // Wake/move at hour&lt;br /&gt;
      DailyRoutine@quests({&amp;quot;wake&amp;quot;, &amp;quot;walkto::$2t&amp;quot;, ...}, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    if (mudhour == sch.[1]) {  // Evening routine&lt;br /&gt;
      DailyRoutine@quests({&amp;quot;walkto::grunting_inn@midgaard&amp;quot;, &amp;quot;buy beer&amp;quot;, &amp;quot;sleep&amp;quot;}, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Corpse scavenger** &lt;br /&gt;
```&lt;br /&gt;
dilbegin janitors(rate: integer);&lt;br /&gt;
var trash: unitptr;&lt;br /&gt;
code {&lt;br /&gt;
  foreach (UNIT_ST_OBJ, trash) {  // Scan surroundings for objects&lt;br /&gt;
    if (trash.objecttype == ITEM_CONTAINER &amp;amp;&amp;amp; isaff(trash, ID_CORPSE)) {&lt;br /&gt;
      // No need to secure item, foreach does it automatically&lt;br /&gt;
      exec(&amp;quot;get all from corpse&amp;quot;, self);&lt;br /&gt;
      // Scavenger would quickly be unable to carry more&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
# ZONE example with DIL examples&lt;br /&gt;
```&lt;br /&gt;
/*&lt;br /&gt;
filename    minimal-zone&lt;br /&gt;
password    testpass&lt;br /&gt;
changedby   AI Assistant&lt;br /&gt;
EmailAdd&lt;br /&gt;
request     compile&lt;br /&gt;
version     1&lt;br /&gt;
END HEADER*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;macros.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%zone&lt;br /&gt;
title &amp;quot;Minimal Test Zone@Mainland&amp;quot;&lt;br /&gt;
lifespan 10&lt;br /&gt;
reset RESET_ANYHOW&lt;br /&gt;
creators {&amp;quot;ai_assistant&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
notes&lt;br /&gt;
&amp;quot;A minimal zone demonstrating all major Haon-Dor zone fields and expressions.&lt;br /&gt;
Contains two comprehensive DIL examples:&lt;br /&gt;
1. comprehensive_demo() - Advanced DIL patterns for LLM learning&lt;br /&gt;
2. simple_demo() - Basic DIL patterns for beginners&lt;br /&gt;
Both examples demonstrate key concepts: variables, control flow, string/integer&lt;br /&gt;
operations, unit manipulation, combat, time functions, and more.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
help&lt;br /&gt;
&amp;quot;This is a minimal test zone created to demonstrate all of the key zone fields&lt;br /&gt;
and expressions used in Haon-Dor. Contains comprehensive DIL examples perfect&lt;br /&gt;
for learning DIL programming patterns. Zone by AI Assistant.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
%dil&lt;br /&gt;
/* ========================================================================&lt;br /&gt;
   COMPREHENSIVE DIL EXAMPLE - Perfect for LLM Learning&lt;br /&gt;
   This example demonstrates the most important DIL concepts and patterns&lt;br /&gt;
   ======================================================================== */&lt;br /&gt;
&lt;br /&gt;
dilbegin demo();&lt;br /&gt;
var&lt;br /&gt;
   target_player : unitptr;     // Unit pointer for finding players&lt;br /&gt;
   random_num : integer;        // For random number generation&lt;br /&gt;
   message_text : string;       // For string manipulation&lt;br /&gt;
   item_found : unitptr;        // For object manipulation&lt;br /&gt;
   oppo : unitptr;              // For combat operations&lt;br /&gt;
   plyr : unitptr;&lt;br /&gt;
   health_pct : integer;        // For calculations&lt;br /&gt;
   current_hour : integer;      // For time functions&lt;br /&gt;
   intr_hdl : integer;&lt;br /&gt;
   sl : stringlist;&lt;br /&gt;
   i : integer;&lt;br /&gt;
&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   // Set heartbeat to check every 5 seconds&lt;br /&gt;
   heartbeat := PULSE_SEC * 5;&lt;br /&gt;
   &lt;br /&gt;
   // Skip execution if NPC is asleep or fighting&lt;br /&gt;
   on_activation((self.position &amp;lt;= POSITION_SLEEPING), skip);&lt;br /&gt;
   interrupt(SFB_COM, activator == self, imfighting);&lt;br /&gt;
&lt;br /&gt;
 :main_loop:&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 1. COMMAND WAITING - Basic interaction pattern&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   wait(SFB_CMD, command(&amp;quot;say&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
   if (not (&amp;quot;hello&amp;quot; in argument) and not (&amp;quot;greet&amp;quot; in argument))&lt;br /&gt;
     goto main_loop;&lt;br /&gt;
   &lt;br /&gt;
   if (activator.type == UNIT_ST_PC)&lt;br /&gt;
   {&lt;br /&gt;
      plyr := activator;&lt;br /&gt;
      secure(plyr, main_loop);&lt;br /&gt;
&lt;br /&gt;
      // String concatenation with itoa() for numbers&lt;br /&gt;
      message_text := &amp;quot;Greetings, &amp;quot; + plyr.name + &amp;quot;! Your level is &amp;quot; + itoa(plyr.level) + &amp;quot;.&amp;quot;;&lt;br /&gt;
      exec(&amp;quot;say &amp;quot; + message_text, self);&lt;br /&gt;
      pause; // After this pause plyr is null&lt;br /&gt;
      &lt;br /&gt;
      // Random number generation and conditional logic&lt;br /&gt;
      random_num := rnd(1, 100);&lt;br /&gt;
      if (random_num &amp;gt; 70)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;emote smiles warmly.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
      else if (random_num &amp;gt; 30)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;emote nods politely.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;emote watches you with interest.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 2. TIME FUNCTIONS - Demonstrate game time awareness&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   current_hour := mudhour;&lt;br /&gt;
   sl := {&amp;quot;say Good morning to you!&amp;quot;, &amp;quot;say Good afternoon!&amp;quot;, &amp;quot;say What a lovely time to be alive!&amp;quot;};&lt;br /&gt;
   if (current_hour &amp;gt;= 6 and current_hour &amp;lt; 12) &lt;br /&gt;
      i := 0;&lt;br /&gt;
   else if (current_hour &amp;gt;= 12 and current_hour &amp;lt; 18)&lt;br /&gt;
      i := 1;&lt;br /&gt;
   else&lt;br /&gt;
      i := 2;&lt;br /&gt;
&lt;br /&gt;
   exec(sl.[i], self);&lt;br /&gt;
   pause;&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 3. UNIT SEARCHING - Find and interact with nearby units&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   target_player := findrndunit(self, FIND_UNIT_SURRO, UNIT_ST_PC);&lt;br /&gt;
   if (target_player != null)&lt;br /&gt;
   {&lt;br /&gt;
      // Health percentage calculation&lt;br /&gt;
      health_pct := (target_player.hp * 100) / target_player.max_hp;&lt;br /&gt;
      &lt;br /&gt;
      if (health_pct &amp;lt; 50)&lt;br /&gt;
      {&lt;br /&gt;
         act(&amp;quot;$1n says 'You look wounded! Let me help you.'&amp;quot;,&lt;br /&gt;
             A_SOMEONE, self, null, null, TO_ROOM);&lt;br /&gt;
         pause;&lt;br /&gt;
         &lt;br /&gt;
         // Healing demonstration&lt;br /&gt;
         target_player.hp := target_player.hp + 10;&lt;br /&gt;
         act(&amp;quot;$1n touches $3n, who feels slightly better.&amp;quot;,&lt;br /&gt;
             A_SOMEONE, self, null, target_player, TO_NOTVICT);&lt;br /&gt;
         act(&amp;quot;$1n touches you, and you feel slightly better.&amp;quot;,&lt;br /&gt;
             A_SOMEONE, self, null, target_player, TO_VICT);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 4. OBJECT MANIPULATION - Search for and handle items&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   foreach (UNIT_ST_OBJ, item_found)&lt;br /&gt;
   {&lt;br /&gt;
      if (item_found.outside == self)  // Item is on the NPC&lt;br /&gt;
      {&lt;br /&gt;
         if (item_found.objecttype == ITEM_WEAPON)&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say I am armed with &amp;quot; + item_found.title, self);&lt;br /&gt;
            break;  // Exit foreach loop after finding first weapon&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
      else if (item_found.outside == self.outside)  // Item is in the same room&lt;br /&gt;
      {&lt;br /&gt;
         if (item_found.objecttype == ITEM_CONTAINER)&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say I see a container here: &amp;quot; + item_found.title, self);&lt;br /&gt;
            break;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   pause;&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 5. COMBAT OPERATIONS - Basic combat AI&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   if (self.position == POSITION_FIGHTING)&lt;br /&gt;
   {&lt;br /&gt;
      oppo := self.fighting;&lt;br /&gt;
      if (oppo != null)&lt;br /&gt;
      {&lt;br /&gt;
         // Combat taunts based on oppo type&lt;br /&gt;
         if (oppo.type == UNIT_ST_PC)&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say You should not have challenged me!&amp;quot;, self);&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say Die, foul creature!&amp;quot;, self);&lt;br /&gt;
         }&lt;br /&gt;
         pause;&lt;br /&gt;
         &lt;br /&gt;
         // Wait for combat to end&lt;br /&gt;
         while (self.position == POSITION_FIGHTING)&lt;br /&gt;
            pause;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 6. MOVEMENT AND EXPLORATION - Room navigation&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   random_num := rnd(1, 10);&lt;br /&gt;
   if (random_num &amp;lt;= 3)  // 30% chance to move&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say I think I'll take a little walk.&amp;quot;, self);&lt;br /&gt;
      pause;&lt;br /&gt;
      &lt;br /&gt;
      // Try random directions (simplified example)&lt;br /&gt;
      random_num := rnd(1, 4);&lt;br /&gt;
      if (random_num == 1)&lt;br /&gt;
         exec(&amp;quot;north&amp;quot;, self);&lt;br /&gt;
      else if (random_num == 2)&lt;br /&gt;
         exec(&amp;quot;south&amp;quot;, self);&lt;br /&gt;
      else if (random_num == 3)&lt;br /&gt;
         exec(&amp;quot;east&amp;quot;, self);&lt;br /&gt;
      else&lt;br /&gt;
         exec(&amp;quot;west&amp;quot;, self);&lt;br /&gt;
      &lt;br /&gt;
      pause;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 7. ALIGNMENT AND ROLEPLAYING - React to player alignment&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   if (plyr.type == UNIT_ST_PC)&lt;br /&gt;
   {&lt;br /&gt;
      if (plyr.alignment &amp;lt; -300)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;say Your evil nature disturbs me.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
         exec(&amp;quot;emote watches you warily.&amp;quot;, self);&lt;br /&gt;
      }&lt;br /&gt;
      else if (plyr.alignment &amp;gt; 300)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;say It is good to see a noble soul like yourself!&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
         exec(&amp;quot;emote smiles warmly.&amp;quot;, self);&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;say You seem to walk the middle path.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 8. MEMORY AND STATE - Simple quest/interaction tracking&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // Check if player has a specific quest flag (simplified example)&lt;br /&gt;
   if (plyr.type == UNIT_ST_PC)&lt;br /&gt;
   {&lt;br /&gt;
      // This would normally check quest flags, simplified for demo&lt;br /&gt;
      exec(&amp;quot;say I remember meeting you before.&amp;quot;, self);&lt;br /&gt;
      pause;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   unsecure(plyr);&lt;br /&gt;
   // Loop back to main loop&lt;br /&gt;
   goto main_loop;&lt;br /&gt;
&lt;br /&gt;
:imfighting:&lt;br /&gt;
   exec(&amp;quot;say Darn it! I hate being in combat all the time&amp;quot;, self);&lt;br /&gt;
   // We could clear the interrupt here with&lt;br /&gt;
   // clear(intr_hdl);&lt;br /&gt;
   // But let's keep it coming.&lt;br /&gt;
   goto main_loop;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
/* ========================================================================&lt;br /&gt;
   SIMPLE DIL EXAMPLE - Basic patterns for beginners&lt;br /&gt;
   This demonstrates fundamental DIL concepts in a simple, clear way&lt;br /&gt;
   ======================================================================== */&lt;br /&gt;
&lt;br /&gt;
dilbegin basic();&lt;br /&gt;
var&lt;br /&gt;
   player : unitptr;          // Unit pointer for players&lt;br /&gt;
   roll : integer;            // Random number storage&lt;br /&gt;
   greeting : string;         // String manipulation&lt;br /&gt;
&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   // Check every 10 seconds&lt;br /&gt;
   heartbeat := PULSE_SEC * 10;&lt;br /&gt;
   &lt;br /&gt;
   // Don't run if asleep or fighting&lt;br /&gt;
   on_activation((self.position &amp;lt;= POSITION_SLEEPING) or&lt;br /&gt;
                 (self.position == POSITION_FIGHTING), skip);&lt;br /&gt;
&lt;br /&gt;
   :start:&lt;br /&gt;
   &lt;br /&gt;
   // Wait for any command from players or npcs&lt;br /&gt;
   wait(SFB_CMD, TRUE);&lt;br /&gt;
   &lt;br /&gt;
   // Only respond to players, not other NPCs&lt;br /&gt;
   if (activator.type != UNIT_ST_PC)&lt;br /&gt;
      goto start;&lt;br /&gt;
   &lt;br /&gt;
   player := activator;&lt;br /&gt;
&lt;br /&gt;
   // If the char leaves, reset and go back to start&lt;br /&gt;
   // right after the exec, player can be reset&lt;br /&gt;
   // unless we add this secure&lt;br /&gt;
   secure(player, start);&lt;br /&gt;
&lt;br /&gt;
   // Basic greeting with string concatenation&lt;br /&gt;
   greeting := &amp;quot;Hello, &amp;quot; + player.name + &amp;quot;!&amp;quot;;&lt;br /&gt;
   exec(&amp;quot;say &amp;quot; + greeting, self);&lt;br /&gt;
   pause;&lt;br /&gt;
&lt;br /&gt;
   // We cannot use activator down here because it'll be null&lt;br /&gt;
   &lt;br /&gt;
   // Random response pattern&lt;br /&gt;
   roll := rnd(1, 3);&lt;br /&gt;
   if (roll == 1)&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say It's a fine day for adventure!&amp;quot;, self);&lt;br /&gt;
   }&lt;br /&gt;
   else if (roll == 2)&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;hug &amp;quot; + player.name, self);&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say May fortune favor you!&amp;quot;, self);&lt;br /&gt;
   }&lt;br /&gt;
   pause;&lt;br /&gt;
   &lt;br /&gt;
   // Simple health check&lt;br /&gt;
   if (player.hp &amp;lt; player.max_hp / 2)&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say You look wounded - be careful!&amp;quot;, self);&lt;br /&gt;
      pause;&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   unsecure(player);&lt;br /&gt;
&lt;br /&gt;
   // Loop back&lt;br /&gt;
   goto start;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
%rooms&lt;br /&gt;
&lt;br /&gt;
/* Minimal room demonstrating all key room fields */&lt;br /&gt;
minimal_room&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;minimal room&amp;quot;, &amp;quot;room&amp;quot;}&lt;br /&gt;
title &amp;quot;A Minimal Room&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a minimal room demonstrating all the key room fields and&lt;br /&gt;
expressions used in Haon-Dor. The room is simple but contains examples of&lt;br /&gt;
all major room properties.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;wall&amp;quot;, &amp;quot;walls&amp;quot;}&lt;br /&gt;
&amp;quot;The walls are made of simple stone blocks.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;floor&amp;quot;, &amp;quot;ground&amp;quot;}&lt;br /&gt;
&amp;quot;The floor is made of rough wooden planks.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;ceiling&amp;quot;}&lt;br /&gt;
&amp;quot;The ceiling is low and made of dark wooden beams.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
movement SECT_INSIDE&lt;br /&gt;
gmap(100,100)&lt;br /&gt;
&lt;br /&gt;
flags {UNIT_FL_INDOORS, UNIT_FL_NO_WEATHER, UNIT_FL_NO_MOB}&lt;br /&gt;
OUT_DARK_NON_NOON&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Second room for exit demonstrations */&lt;br /&gt;
minimal_room2&lt;br /&gt;
&lt;br /&gt;
title &amp;quot;Another Minimal Room&amp;quot;&lt;br /&gt;
descr &amp;quot;This is the second minimal room, used to demonstrate various exit&lt;br /&gt;
types and room connections.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;ceiling&amp;quot;}&lt;br /&gt;
&amp;quot;The ceiling is low and made of dark wooden beams.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
movement SECT_INSIDE&lt;br /&gt;
gmap(100,101)&lt;br /&gt;
&lt;br /&gt;
flags {UNIT_FL_INDOORS, UNIT_FL_NO_WEATHER}&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Third room for special terrain */&lt;br /&gt;
minimal_room3&lt;br /&gt;
&lt;br /&gt;
title &amp;quot;Room with Special Terrain&amp;quot;&lt;br /&gt;
descr &amp;quot;This room demonstrates special terrain types and movement&lt;br /&gt;
sectors. The ground here is different from other rooms.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;terrain&amp;quot;, &amp;quot;ground&amp;quot;}&lt;br /&gt;
&amp;quot;The terrain here is rough and uneven, making movement difficult.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
movement SECT_FOREST&lt;br /&gt;
gmap(100,99)&lt;br /&gt;
&lt;br /&gt;
OUT_DARK_NON_NOON&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
%objects&lt;br /&gt;
&lt;br /&gt;
/* Minimal object demonstrating all key object fields */&lt;br /&gt;
minimal_key&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;key&amp;quot;, &amp;quot;minimal key&amp;quot;}&lt;br /&gt;
title &amp;quot;a small minimal key&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a small, simple key that seems to fit minimal locks.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;lock&amp;quot;, &amp;quot;mechanism&amp;quot;}&lt;br /&gt;
&amp;quot;The key has a simple mechanism with basic teeth.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This key can be identified to reveal its purpose.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cost 10 IRON_PIECE&lt;br /&gt;
rent 1 IRON_PIECE&lt;br /&gt;
&lt;br /&gt;
manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD}&lt;br /&gt;
type ITEM_KEY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
weight 1&lt;br /&gt;
bright 0&lt;br /&gt;
&lt;br /&gt;
key minimal_key&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Weapon example */&lt;br /&gt;
minimal_sword&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;sword&amp;quot;, &amp;quot;minimal sword&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal sword&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple, unadorned sword with minimal decoration.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;blade&amp;quot;, &amp;quot;hilt&amp;quot;}&lt;br /&gt;
&amp;quot;The blade is plain but sharp. The hilt is wrapped in basic leather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This sword can be identified to reveal its craftsmanship.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$improved identify&amp;quot;}&lt;br /&gt;
&amp;quot;This sword can be identified to reveal its craftsmanship.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
WEAPON_DEF(WPN_SCIMITAR, BONUS_AVERAGE, BONUS_AVERAGE)&lt;br /&gt;
&lt;br /&gt;
cost 50 IRON_PIECE&lt;br /&gt;
rent 5 IRON_PIECE&lt;br /&gt;
flags {UNIT_FL_MAGIC}&lt;br /&gt;
&lt;br /&gt;
weight 10&lt;br /&gt;
bright 0&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Container example */&lt;br /&gt;
minimal_chest&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;chest&amp;quot;, &amp;quot;minimal chest&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal chest&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple wooden chest with minimal decoration.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;lock&amp;quot;, &amp;quot;hinges&amp;quot;}&lt;br /&gt;
&amp;quot;The chest has a simple lock and basic metal hinges.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This chest can be identified to reveal its contents capacity.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cost 25 IRON_PIECE&lt;br /&gt;
rent 2 IRON_PIECE&lt;br /&gt;
&lt;br /&gt;
manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD}&lt;br /&gt;
type ITEM_CONTAINER&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
weight 15&lt;br /&gt;
bright 0&lt;br /&gt;
&lt;br /&gt;
capacity 50&lt;br /&gt;
key minimal_key&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
%mobiles&lt;br /&gt;
&lt;br /&gt;
/* Minimal NPC demonstrating all key NPC fields */&lt;br /&gt;
minimal_guard&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;guard&amp;quot;, &amp;quot;minimal guard&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal guard&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple guard with minimal equipment and basic appearance.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;armor&amp;quot;, &amp;quot;weapon&amp;quot;}&lt;br /&gt;
&amp;quot;The guard wears basic leather armor and carries a simple sword.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This guard can be identified to reveal his combat capabilities.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dilcopy demo@minimal_zone();&lt;br /&gt;
&lt;br /&gt;
M_AVG_HUMAN(5, SEX_MALE)&lt;br /&gt;
&lt;br /&gt;
alignment 100&lt;br /&gt;
exp 100&lt;br /&gt;
&lt;br /&gt;
position POSITION_STANDING&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Second NPC for variety */&lt;br /&gt;
minimal_merch&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;merchant&amp;quot;, &amp;quot;minimal merchant&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal merchant&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple merchant with basic goods and minimal haggling skills.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;goods&amp;quot;, &amp;quot;wares&amp;quot;}&lt;br /&gt;
&amp;quot;The merchant has a small selection of basic goods for sale.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This merchant can be identified to reveal her shop inventory.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dilcopy basic@minimal_zone();&lt;br /&gt;
dilcopy qstSimpleQuest@quests(&amp;quot;Merchant Quest&amp;quot;,&lt;br /&gt;
    {&amp;quot;say I need a specific key - or ANY kind of carrot! Can you help?&amp;quot;,&lt;br /&gt;
     &amp;quot;say Please bring me the key quickly!&amp;quot;},&lt;br /&gt;
    {&amp;quot;say Thanks for the key!&amp;quot;},&lt;br /&gt;
    &amp;quot;Fetch a key for minimal merchant in minimal world.&amp;quot;,&lt;br /&gt;
    {&amp;quot;thank $1N&amp;quot;,&lt;br /&gt;
     &amp;quot;emote adores his new key.&amp;quot;},&lt;br /&gt;
    500, 1 * COPPER_MULT, {&amp;quot;&amp;quot;}, &amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The empty stringlist {&amp;quot;&amp;quot;} could be a custom DIL function to validate each item,&lt;br /&gt;
// e.g. if a barrel is more than half full of water or if it's a real boat &amp;quot;boatcheck@quests&amp;quot;.&lt;br /&gt;
// By default it's just checking name matching&lt;br /&gt;
dilcopy qstItemsWanted@quests(QUEST_MY_FETCH, {&amp;quot;carrot&amp;quot;, &amp;quot;minimal_key@minimal_zone&amp;quot;}, {&amp;quot;&amp;quot;},&lt;br /&gt;
    {&amp;quot;say Perfect, that's just the key I needed!&amp;quot;},&lt;br /&gt;
    &amp;quot;say I need a specific key, not that garbage!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
M_AVG_HUMAN(3, SEX_FEMALE)&lt;br /&gt;
&lt;br /&gt;
alignment 0&lt;br /&gt;
exp 50&lt;br /&gt;
&lt;br /&gt;
position POSITION_STANDING&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
%reset&lt;br /&gt;
&lt;br /&gt;
/* Reset actions demonstrating all key reset expressions */&lt;br /&gt;
&lt;br /&gt;
/* Load NPCs */&lt;br /&gt;
load minimal_guard into minimal_room max 1&lt;br /&gt;
{&lt;br /&gt;
    equip minimal_sword position WEAR_WIELD max 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
load minimal_merch into minimal_room2 max 1&lt;br /&gt;
&lt;br /&gt;
/* Load objects */&lt;br /&gt;
load minimal_key into minimal_guard max 1&lt;br /&gt;
load minimal_chest into minimal_room max 1&lt;br /&gt;
load minimal_key into minimal_chest max 1&lt;br /&gt;
load minimal_sword into minimal_room max 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* Door states */&lt;br /&gt;
door minimal_room NORTH {EX_OPEN_CLOSE}&lt;br /&gt;
&lt;br /&gt;
/* Local objects (zone-wide) */&lt;br /&gt;
load minimal_key local 5&lt;br /&gt;
&lt;br /&gt;
/* Zone max objects */&lt;br /&gt;
load minimal_sword zonemax 10&lt;br /&gt;
&lt;br /&gt;
/* Zone reset time */&lt;br /&gt;
&lt;br /&gt;
%end&lt;br /&gt;
```&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/AGENT&amp;diff=1268</id>
		<title>Manual:DIL Manual/AGENT</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/AGENT&amp;diff=1268"/>
		<updated>2025-12-06T07:43:43Z</updated>

		<summary type="html">&lt;p&gt;Papi: Created page with &amp;quot;# DikuMUD3 DIL (DikuMUD Interactive Language) Reference  This document provides a comprehensive AGENT.md reference for DIL - the scripting language used in DikuMUD3 for creati...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;# DikuMUD3 DIL (DikuMUD Interactive Language) Reference&lt;br /&gt;
&lt;br /&gt;
This document provides a comprehensive AGENT.md reference for DIL - the scripting language used in DikuMUD3 for creating interactive game content, NPCs, objects and complex game systems. &lt;br /&gt;
&lt;br /&gt;
## Compiling a zone&lt;br /&gt;
To compile a zone: cd vme/zone/ &amp;amp;&amp;amp; vme/bin/vmc -I../include/ zonename.zon&lt;br /&gt;
&lt;br /&gt;
## Zones with good DIL examples&lt;br /&gt;
- vme/zone/haon_dor.zon&lt;br /&gt;
- vme/zone/udgaard.zon&lt;br /&gt;
- vme/zone/midgaard.zon&lt;br /&gt;
- vme/zone/cypress.zon&lt;br /&gt;
&lt;br /&gt;
## Quest helper DIL functions&lt;br /&gt;
Look in **vme/zone/quests.zon** for the DIL library of quest helper functions broadly exemplified in **vme/zone/haon-dor.zon**.&lt;br /&gt;
Look in **vme/zone/randomt.zon** for generating random treasure in DIL.&lt;br /&gt;
&lt;br /&gt;
## 📚 **Core Documentation**&lt;br /&gt;
**🔗 Quick Access**: This condensed list covers all 314+ DIL language features. Each entry is reference their respective .wiki files in the DikuMUD3 DIL Manual documentation system. [string] for example is detailed in **vme/src/mcp/string.wiki**&lt;br /&gt;
&lt;br /&gt;
## 🔧 **Language Overview**&lt;br /&gt;
&lt;br /&gt;
### Data Types&lt;br /&gt;
- **[integer]** - Numeric data type: `health := 100; damage := 25; remaining := health - damage;`&lt;br /&gt;
- **[string]** - Text data type: `name := &amp;quot;Player&amp;quot;; message := name + &amp;quot; has &amp;quot; + itoa(health) + &amp;quot; HP&amp;quot;;`&lt;br /&gt;
- **[unitptr]** - Unit pointer: `target := activator; npc := findunit(&amp;quot;guard&amp;quot;, UNIT_ST_NPC);`&lt;br /&gt;
- **[integerlist]** - Integer collections: `skills := {5, 3, 6, 9}; level := skills.[2]; // == 6`&lt;br /&gt;
- **[stringlist]** - String collections: `names := {&amp;quot;Alice&amp;quot;,&amp;quot;Bob&amp;quot;,&amp;quot;Charlie&amp;quot;}; first := names.[0];`&lt;br /&gt;
- **[null]** - Null value: `if (self.fighting == null) { /* not fighting anyone */ }`&lt;br /&gt;
&lt;br /&gt;
### Type Conversion&lt;br /&gt;
- **[atoi]** - String to integer: `num := atoi(&amp;quot;42&amp;quot;); // num == 42`&lt;br /&gt;
- **[itoa]** - Integer to string: `str := itoa(100); // str == &amp;quot;100&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
### Built-in Variables&lt;br /&gt;
- **[self]** - Current executing unit: `hp_pct := (self.hp * 100) / self.max_hp;`&lt;br /&gt;
- **[activator]** - Unit that triggered program: `if (activator.level &amp;gt;= IMMORTAL_LEVEL) { /* admin access */ }`&lt;br /&gt;
- **[argument]** - Command arguments: `wait(SFB_CMD, command(&amp;quot;hello&amp;quot;)); if (argument != &amp;quot;&amp;quot;) { send(&amp;quot;Hello &amp;quot; + argument + &amp;quot;!&amp;quot;); }`&lt;br /&gt;
- **[command]** - Command name: `if (command(&amp;quot;north&amp;quot;)) { act(&amp;quot;You go north.&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[cmdstr]** - Full command string: `full_cmd := cmdstr + &amp;quot; &amp;quot; + argument; act(&amp;quot;Full: &amp;quot; + full_cmd, A_ALWAYS, self, null, null, TO_CHAR);`&lt;br /&gt;
- **[cmdptr]** - Command pointer: `cmd := getcommand(&amp;quot;say&amp;quot;); if (cmd) { send(&amp;quot;Command level: &amp;quot; + itoa(cmd.level), self); }`&lt;br /&gt;
- **[excmdstr]** - Command string (lowercase): `if (excmdstr != &amp;quot;quit&amp;quot;) { sendtext(&amp;quot;You must type 'quit' to quit.&amp;quot;, self); }`&lt;br /&gt;
- **[excmdstr_case]** - Command string (case-sensitive): `if (length(excmdstr_case) &amp;lt; 5) { sendtext(&amp;quot;Password too short.&amp;quot;, self); }`&lt;br /&gt;
- **[heartbeat]** - Program timing: `heartbeat := PULSE_SEC * 10; // Tick every 10 seconds`&lt;br /&gt;
- **[medium]** - Operation medium: `container := medium; if (container != null) { act(&amp;quot;Using $1n as medium.&amp;quot;, A_ALWAYS, self, container, null, TO_CHAR); }`&lt;br /&gt;
- **[power]** - Action power: `if (power &amp;gt; 100) { sendtext(&amp;quot;This is a very powerful spell!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Control Structures&lt;br /&gt;
- **[if]** - Conditional statement: `if (self.hp &amp;gt; 10) { exec(&amp;quot;say Hehe!&amp;quot;, self); } else { exec(&amp;quot;say ouch!&amp;quot;, self); }`&lt;br /&gt;
- **[while]** - Loop construct: `while (self.inside) { if (self.position &amp;amp; POSITION_SLEEPING) break; pause; }`&lt;br /&gt;
- **[foreach]** - Loop construct: `foreach (UNIT_ST_PC|UNIT_ST_NPC, u) { if (u.hp &amp;lt; u.max_hp) { u.hp := u.hp + 6; } pause; }`&lt;br /&gt;
- **[goto]** - Unconditional jump: `:main_loop: pause; goto main_loop; // Create infinite loop`&lt;br /&gt;
- **[on_goto]** - Goto construct: `on direction goto (north, south, east, west); // 0=north, 1=south, etc.`&lt;br /&gt;
- **[break]** - Exit loop: `foreach (UNIT_ST_PC, target) { if (target.hp &amp;lt; target.max_hp / 2) { break; } }`&lt;br /&gt;
- **[continue]** - Continue iteration: `foreach (UNIT_ST_OBJ, item) { if (not isset(item.manipulate, MANIPULATE_TAKE)) continue; }`&lt;br /&gt;
- **[return]** - Return from function: `return(damage); // Functions: return value; Procedures: return;`&lt;br /&gt;
- **[quit]** - Terminate program: `if (input == &amp;quot;exit&amp;quot;) { sendtext(&amp;quot;Goodbye!&amp;quot;, self); quit; }`&lt;br /&gt;
- **[block]** - Block commands: `wait(SFB_CMD, command(&amp;quot;forbidden&amp;quot;)); block; send(&amp;quot;Command blocked!&amp;quot;, activator);`&lt;br /&gt;
&lt;br /&gt;
**⚠️ IMPORTANT:** DIL does NOT support C-style `for` loops. Use `while` loops instead.&lt;br /&gt;
&lt;br /&gt;
### Operators&lt;br /&gt;
- **[and]** - Logical operators: `if (self.level &amp;gt;= 10 and self.hp &amp;gt; 50) { /* ready for combat */ }`&lt;br /&gt;
- **[or]** - Logical operators: `if (self.level &amp;lt; 10 or self.hp &amp;lt;= 0) { /* not ready */ }`&lt;br /&gt;
- **[not]** - Logical operators: `if (not (self.fighting)) { /* not in combat */ }`&lt;br /&gt;
- **[set]** - Bit operations: `set(self.pcflags, PC_WIZARD); // Set wizard mode flag`&lt;br /&gt;
- **[unset]** - Bit operations: `unset(self.charflags, CHAR_SELF_DEFENCE); // Clear defence flag`&lt;br /&gt;
- **[isset]** - Bit operations: `if (isset(self.flags, UNIT_FL_BURIED)) { /* item is buried */ }`&lt;br /&gt;
&lt;br /&gt;
### Unit Fields&lt;br /&gt;
- **[type]** - Unit type: `if (target.type == UNIT_ST_PC) { sendtext(&amp;quot;This is a player character.&amp;quot;, self); }`&lt;br /&gt;
- **[inside]** - Unit positioning: `item := chest.inside; if (item != null) { sendtext(&amp;quot;Found: &amp;quot; + item.name, self); }`&lt;br /&gt;
- **[outside]** - Unit positioning: `container := item.outside; if (container != null) { act(&amp;quot;$1n is in $2n&amp;quot;, A_ALWAYS, self, item, container, TO_CHAR); }`&lt;br /&gt;
- **[bright]** - Lighting: `torch_brightness := bright(self); sendtext(&amp;quot;Torch brightness: &amp;quot; + itoa(torch_brightness), self);`&lt;br /&gt;
- **[setbright]** - Set brightness: `setbright(torch, 3); // Make torch emit more light`&lt;br /&gt;
- **[light]** - Lighting: `light_count := self.light; sendtext(&amp;quot;This unit contains &amp;quot; + itoa(light_count) + &amp;quot; light sources.&amp;quot;, self); }`&lt;br /&gt;
- **[illum]** - Contained light: `if (container.illum &amp;gt; 0) { sendtext(&amp;quot;Container glows from within.&amp;quot;, self); }`&lt;br /&gt;
- **[name]** - Object identification: `item_name := item.name; sendtext(&amp;quot;This is called: &amp;quot; + item_name, self); }`&lt;br /&gt;
- **[title]** - Object identification: `obj.title := &amp;quot;A shiny sword&amp;quot;; sendtext(&amp;quot;Item title updated to: &amp;quot; + obj.title, self); }`&lt;br /&gt;
- **[descr]** - Object identification: `extra.descr := &amp;quot;This item glows with magical energy.&amp;quot;; // Set extra description`&lt;br /&gt;
- **[inside_descr]** - Internal description: `room.inside_descr := &amp;quot;This room has been modified.&amp;quot;; // Change room description`&lt;br /&gt;
- **[outside_descr]** - External description: `target.outside_descr := &amp;quot;A mysterious figure stands here.&amp;quot;; // Set external description`&lt;br /&gt;
- **[weight]** - Weight: `total_weight := pc.weight; capacity := pc.capacity; if (total_weight &amp;gt; capacity) { /* overburdened */ }`&lt;br /&gt;
- **[baseweight]** - Weight: `empty_weight := baseweight(chest); // Get chest weight without contents`&lt;br /&gt;
- **[set_weight]** - Set total weight: `set_weight(item, 50); // Set total weight including contents`&lt;br /&gt;
- **[set_weight_base]** - Set base weight: `set_weight_base(item, 20); // Set empty weight of object`&lt;br /&gt;
- **[capacity]** - Carrying capacity: `max_cap := capacity(self); remaining := max_cap - weight(self); send(&amp;quot;Capacity: &amp;quot; + itoa(remaining) + &amp;quot; remaining&amp;quot;, self);`&lt;br /&gt;
- **[flags]** - Unit flags: `if (isset(self.flags, UNIT_FL_INVISIBLE)) { unset(self.flags, UNIT_FL_INVISIBLE); act(&amp;quot;You become visible!&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[idx]** - Unique ID: `guard_id := guard.idx; // Get unique identifier for tracking`&lt;br /&gt;
- **[key]** - Lock identifier: `if (item.key != &amp;quot;&amp;quot;) { sendtext(&amp;quot;Key required: &amp;quot; + item.key, self); }`&lt;br /&gt;
- **[loadcount]** - Instance tracking: `if (item.loadcount &amp;gt; 10) { destroy(item); log(&amp;quot;Too many instances loaded&amp;quot;); }`&lt;br /&gt;
- **[nameidx]** - Database name: `unit_id := item.nameidx + &amp;quot;@&amp;quot; + item.zoneidx; // Unique reference`&lt;br /&gt;
- **[manipulate]** - Object handling: `if (isset(item.manipulate, MANIPULATE_TAKE)) { sendtext(&amp;quot;You can take this item.&amp;quot;, self); }`&lt;br /&gt;
- **[minv]** - Wizard invisibility: `if (item.minv &amp;gt; self.level) { sendtext(&amp;quot;You can't see this item.&amp;quot;, self); }`&lt;br /&gt;
- **[names]** - Name list: `item_names := item.names; if (&amp;quot;sword&amp;quot; in item_names) { sendtext(&amp;quot;This is a sword.&amp;quot;, self); }`&lt;br /&gt;
- **[opendiff]** - Lock difficulty: `if (chest.opendiff &amp;gt; 20) { sendtext(&amp;quot;This chest has a very difficult lock.&amp;quot;, self); }`&lt;br /&gt;
- **[openflags]** - Open/lock state: `if (isset(door.openflags, EX_LOCKED)) { sendtext(&amp;quot;The door is locked.&amp;quot;, self); }`&lt;br /&gt;
- **[zone]** - Zone name: `zone_name := item.zone; sendtext(&amp;quot;This item belongs to zone: &amp;quot; + zone_name, self); }`&lt;br /&gt;
&lt;br /&gt;
### Object Fields&lt;br /&gt;
- **[value]** - Economics: `weapon_damage := weapon.value[1]; // Get damage from weapon value array`&lt;br /&gt;
- **[cost]** - Economics: `obj.cost := 1000; obj.rent := 10;`&lt;br /&gt;
- **[rent]** - Economics: `obj.cost := 1000; obj.rent := 10;`&lt;br /&gt;
- **[objectflags]** - Classification: `if (isset(item.objectflags, OBJ_MAGIC)) { act(&amp;quot;$1n glows with magic!&amp;quot;, A_ALWAYS, item, null, null, TO_ROOM); }`&lt;br /&gt;
- **[objecttype]** - Classification: `if (obj.flags &amp;amp; OBJ_FL_MAGIC) { /* magic item */ }`&lt;br /&gt;
&lt;br /&gt;
### Room Fields&lt;br /&gt;
- **[roomflags]** - Room properties: `if (isset(my_room.roomflags, ROOM_FL_DARK)) { sendtext(&amp;quot;This room is dark.&amp;quot;, self); }`&lt;br /&gt;
- **[exit_to]** - Room exits: `if (room.exit_to[NORTH] != null) { sendtext(&amp;quot;There is an exit to the north.&amp;quot;, self); }`&lt;br /&gt;
- **[exit_names]** - Room exits: `names := room.exit_names[NORTH]; if (length(names) &amp;gt; 0) { act(&amp;quot;Exit: &amp;quot; + names.[0], A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[mapx]** - Coordinates: `if (room.mapx != -1 and room.mapy != -1) { act(&amp;quot;Room coordinates: X=$2d, Y=$3d&amp;quot;, A_ALWAYS, self, room.mapx, room.mapy, TO_CHAR); }`&lt;br /&gt;
- **[mapy]** - Coordinates: `distance := (room2.mapx - room1.mapx) + (room2.mapy - room1.mapy);`&lt;br /&gt;
- **[exit_diff]** - Exit difficulty: `difficulty := room.exit_diff[NORTH]; if (skillcheck(SKI_CLIMB, ABIL_DEX, difficulty) &amp;gt; 0) { sendtext(&amp;quot;You climb successfully!&amp;quot;, self); }`&lt;br /&gt;
- **[exit_info]** - Exit flags: `if (isset(room.exit_info[NORTH], EX_CLOSED)) { unset(room.exit_info[NORTH], EX_CLOSED); act(&amp;quot;Door opens!&amp;quot;, A_ALWAYS, self, null, null, TO_ALL); }`&lt;br /&gt;
- **[exit_key]** - Exit key: `key_name := room.exit_key[NORTH]; if (key_name != &amp;quot;&amp;quot; and findsymbolic(key_name, FIND_UNIT_IN_ME)) { sendtext(&amp;quot;You have the key!&amp;quot;, self); }`&lt;br /&gt;
- **[movement]** - Terrain type: `if (room.movement == SECT_WATER_SAIL) { sendtext(&amp;quot;This area requires swimming or a boat!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Character Fields&lt;br /&gt;
- **[level]** - Character levels: `if (self.level &amp;gt;= 10) { sendtext(&amp;quot;You are experienced!&amp;quot;, self); }`&lt;br /&gt;
- **[vlevel]** - Character levels: `lvl := self.level; exp := self.exp;`&lt;br /&gt;
- **[exp]** - Experience points: `xp := self.exp; sendtext(&amp;quot;You have &amp;quot; + itoa(xp) + &amp;quot; experience points.&amp;quot;, self); }`&lt;br /&gt;
- **[experience]** - Modify experience: `experience(1000, player); // Give 1000 XP for quest completion`&lt;br /&gt;
- **[exptol]** - Experience to level: `if (self.exptol &amp;lt;= 0) { sendtext(&amp;quot;You can level up now!&amp;quot;, self); }`&lt;br /&gt;
- **[hp]** - Health: `hp_pct := (self.hp * 100) / self.max_hp; if (self.hp &amp;lt; 10) { /* low health */ }`&lt;br /&gt;
- **[max_hp]** - Health: `hp_pct := (self.hp * 100) / self.max_hp; target.hp := target.max_hp; // Full heal`&lt;br /&gt;
- **[position]** - States: `if (self.position == POSITION_FIGHTING) { /* in combat */ } else if (self.position == POSITION_SLEEPING) { /* asleep */ }`&lt;br /&gt;
- **[defaultpos]** - States: `if (self.position == POSITION_FIGHTING) { /* in combat */ }`&lt;br /&gt;
- **[fighting]** - Combat: `opp := self.fighting; if (opp != null) { sendtext(&amp;quot;Fighting &amp;quot; + opp.name, self); }`&lt;br /&gt;
- **[opponent]** - Combat: `opp := self.fighting;`&lt;br /&gt;
- **[master]** - Social relationships: `leader := self.master; if (leader != null) { act(&amp;quot;You are following $1n.&amp;quot;, A_ALWAYS, self, leader, null, TO_CHAR); }`&lt;br /&gt;
- **[follower]** - Social relationships: `first := self.follower; if (first != null) { act(&amp;quot;$1n is your first follower.&amp;quot;, A_ALWAYS, self, null, first, TO_CHAR); }`&lt;br /&gt;
- **[followercount]** - Social relationships: `count := self.followercount; if (count &amp;gt; 0) { sendtext(&amp;quot;You have &amp;quot; + itoa(count) + &amp;quot; followers.&amp;quot;, self); }`&lt;br /&gt;
- **[opponentcount]** - Combat opponents: `if (self.opponentcount &amp;gt; 1) { sendtext(&amp;quot;You are fighting multiple opponents!&amp;quot;, self); }`&lt;br /&gt;
- **[follow]** - Following control: `follow(prisoner, guard); // Make prisoner follow guard`&lt;br /&gt;
- **[abilities]** - Character attributes: `str := self.abilities[ABIL_STR]; dex := self.abilities[ABIL_DEX];`&lt;br /&gt;
- **[race]** - Character race: `if (self.race == RACE_ELF) { sendtext(&amp;quot;You are an elf!&amp;quot;, self); }`&lt;br /&gt;
- **[sex]** - Character gender: `if (activator.sex == SEX_MALE) { sendtext(&amp;quot;Greetings, sir!&amp;quot;, activator); }`&lt;br /&gt;
- **[speed]** - Combat speed: `if (self.speed &amp;gt; target.speed) { sendtext(&amp;quot;You strike first!&amp;quot;, self); }`&lt;br /&gt;
- **[ability_points]** - Available points: `points := self.ability_points; if (points &amp;gt;= 5) { /* can train */ }`&lt;br /&gt;
- **[ability_costs]** - Training costs: `cost := self.ability_costs[ABIL_STR]; if (money &amp;gt;= cost) { /* can afford training */ }`&lt;br /&gt;
- **[ability_levels]** - Training requirements: `required := self.ability_levels[ABIL_STR]; if (level &amp;gt;= required) { /* can train */ }`&lt;br /&gt;
- **[skill_points]** - Available skill points: `points := self.skill_points; if (points &amp;gt;= 10) { sendtext(&amp;quot;You can train skills!&amp;quot;, self); }`&lt;br /&gt;
- **[skills]** - Skill system: `skill := self.skills.[SKI_BASH];`&lt;br /&gt;
- **[skill_costs]** - Skill training costs: `cost := self.skill_costs[SKI_SWORD]; if (self.exp &amp;gt;= cost) { sendtext(&amp;quot;Can afford skill!&amp;quot;, self); }`&lt;br /&gt;
- **[skill_levels]** - Current skill levels: `level := self.skill_levels[SKI_SWORD]; sendtext(&amp;quot;Sword skill: &amp;quot; + itoa(level), self);`&lt;br /&gt;
- **[spells]** - Magic system: `spell := self.spells.[SPL_FIREBALL];`&lt;br /&gt;
- **[spell_costs]** - Spell learning costs: `cost := self.spell_costs[SPL_FIREBALL]; if (self.exp &amp;gt;= cost) { sendtext(&amp;quot;Can afford spell!&amp;quot;, self); }`&lt;br /&gt;
- **[spell_levels]** - Current spell levels: `level := self.spell_levels[SPL_FIREBALL]; sendtext(&amp;quot;Fireball level: &amp;quot; + itoa(level), self); }`&lt;br /&gt;
- **[alignment]** - Moral standing: `align := alignment(self); if (align &amp;lt; -500) { send(&amp;quot;You are evil!&amp;quot;, self); }`&lt;br /&gt;
- **[birth]** - Character creation: `age_days := (realtime - birth(self)) / 86400; send(&amp;quot;You are &amp;quot; + itoa(age_days) + &amp;quot; days old.&amp;quot;, self); }`&lt;br /&gt;
- **[drunk]** - Character state: `if (self.drunk &amp;gt; 10) { sendtext(&amp;quot;You are drunk!&amp;quot;, self); }`&lt;br /&gt;
- **[full]** - Hunger level: `if (self.full &amp;gt; 20) { sendtext(&amp;quot;You are very hungry.&amp;quot;, self); } else if (self.full &amp;lt; 5) { sendtext(&amp;quot;You feel quite full.&amp;quot;, self); }`&lt;br /&gt;
- **[thirst]** - Thirst level: `if (self.thirst &amp;lt; 5) { sendtext(&amp;quot;You are extremely thirsty!&amp;quot;, self); } else { self.thirst := 24; // Fully quench thirst }`&lt;br /&gt;
- **[endurance]** - Physical stamina: `if (self.endurance &amp;lt; 2) { sendtext(&amp;quot;You are exhausted!&amp;quot;, self); } else { self.endurance := self.endurance - 1; }`&lt;br /&gt;
- **[max_endurance]** - Maximum stamina: `end_pct := (self.endurance * 100) / self.max_endurance; sendtext(&amp;quot;Endurance: &amp;quot; + itoa(end_pct) + &amp;quot;%&amp;quot;, self); }`&lt;br /&gt;
- **[mana]** - Magic points: `if (self.mana &amp;lt; 50) { sendtext(&amp;quot;Not enough mana!&amp;quot;, self); } else { self.mana := self.mana - 50; }`&lt;br /&gt;
- **[max_mana]** - Maximum magic: `mana_pct := (self.mana * 100) / self.max_mana; sendtext(&amp;quot;Mana: &amp;quot; + itoa(mana_pct) + &amp;quot;%&amp;quot;, self); }`&lt;br /&gt;
- **[charflags]** - Character flags: `if (isset(activator.charflags, CHAR_OUTLAW)) { send(&amp;quot;You are an outlaw!&amp;quot;, activator); }`&lt;br /&gt;
- **[crimes]** - Criminal record: `if (activator.crimes &amp;gt; 0) { send(&amp;quot;You have &amp;quot; + itoa(activator.crimes) + &amp;quot; crimes on record.&amp;quot;, activator); }`&lt;br /&gt;
- **[height]** - Physical size: `height_diff := pc.height - armor.height; // Check size compatibility`&lt;br /&gt;
- **[hometown]** - Player origin: `link(player, findroom(player.hometown)); // Send player home`&lt;br /&gt;
- **[lifespan]** - Maximum age: `if (age &amp;gt; self.lifespan) { sendtext(&amp;quot;You have exceeded your lifespan!&amp;quot;, self); }`&lt;br /&gt;
- **[natural_armour]** - Base armor: `if (npc.natural_armour &amp;gt; 50) { sendtext(&amp;quot;This NPC has heavy natural armor.&amp;quot;, self); }`&lt;br /&gt;
- **[position_update]** - Update position: `target.hp := target.hp - damage; position_update(target); // Update after HP change`&lt;br /&gt;
- **[reset_level]** - Reset to level 1: `reset_level(player); // Reset character to starting level`&lt;br /&gt;
- **[reset_race]** - Reset race attributes: `reset_race(player); // Reset weight, height, age, lifespan, training costs`&lt;br /&gt;
- **[reset_vlevel]** - Reset virtual level: `reset_vlevel(player); // Reset virtual level to 1`&lt;br /&gt;
- **[weapon_costs]** - Weapon training costs: `cost := self.weapon_costs[WPN_SWORD]; if (money &amp;gt;= cost) { sendtext(&amp;quot;Can afford sword training!&amp;quot;, self); }`&lt;br /&gt;
- **[weapon_levels]** - Weapon skill levels: `level := self.weapon_levels[WPN_SWORD]; sendtext(&amp;quot;Sword skill level: &amp;quot; + itoa(level), self); }`&lt;br /&gt;
- **[weapons]** - Weapon skills: `skill := self.weapons[WPN_SWORD]; if (skill &amp;gt; 0) { sendtext(&amp;quot;You know sword fighting!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
#### PC fields&lt;br /&gt;
- **[profession]** - PC properties: `if (activator.profession == PROFESSION_THIEF) { sendtext(&amp;quot;Welcome, shadow walker!&amp;quot;, activator); }`&lt;br /&gt;
- **[guild]** - PC properties: `if (activator.guild == &amp;quot;thief&amp;quot;) { sendtext(&amp;quot;Welcome, brother of the shadows!&amp;quot;, activator); }`&lt;br /&gt;
- **[pcflags]** - Player flags: `if (isset(self.pcflags, PC_PK_RELAXED)) { sendtext(&amp;quot;You are signed up for player killing.&amp;quot;, self); }`&lt;br /&gt;
- **[playtime]** - Time played: `hours_played := self.playtime / 3600; sendtext(&amp;quot;You have played for &amp;quot; + itoa(hours_played) + &amp;quot; hours.&amp;quot;, self); }`&lt;br /&gt;
- **[quests]** - Quest list: `found_quest := &amp;quot;dragon_slaying&amp;quot; in self.quests; if (found_quest) { sendtext(&amp;quot;You have the dragon quest!&amp;quot;, self); }`&lt;br /&gt;
- **[switched]** - Character control: `controlled := self.switched; if (controlled) { sendtext(&amp;quot;You are controlling: &amp;quot; + controlled.name, self); }`&lt;br /&gt;
&lt;br /&gt;
#### NPC fields&lt;br /&gt;
- **[npcflags]** - NPC properties: `npcflags(npc, npc.npcflags | NPC_AGGRESSIVE); // Make NPC aggressive`&lt;br /&gt;
&lt;br /&gt;
### String Processing&lt;br /&gt;
- **[length]** - Get string length: `l := length(&amp;quot;hello&amp;quot;); // == 5`&lt;br /&gt;
- **[in]** - String/list membership: `if (&amp;quot;fox&amp;quot; in &amp;quot;The quick brown fox&amp;quot;) { /* found substring */ }`&lt;br /&gt;
- **[left]** - Extract left characters: `l := left(&amp;quot;hello&amp;quot;, 2); // == &amp;quot;he&amp;quot;`&lt;br /&gt;
- **[right]** - Extract right characters: `r := right(&amp;quot;world.txt&amp;quot;, 3); // == &amp;quot;txt&amp;quot;`&lt;br /&gt;
- **[strcmp]** - String comparison: `if (strcmp(password, stored) == 0) { sendtext(&amp;quot;Access granted.&amp;quot;, self); }`&lt;br /&gt;
- **[replace]** - Replace text: `new := replace(&amp;quot;fox&amp;quot;, &amp;quot;cat&amp;quot;, &amp;quot;The quick brown fox jumps over the lazy dog.&amp;quot;);`&lt;br /&gt;
- **[getword]** - Extract first word: `s:=&amp;quot;hello sam&amp;quot;; w := getword(s); // w=&amp;quot;hello&amp;quot;, s=&amp;quot;sam&amp;quot;`&lt;br /&gt;
- **[toupper]** - Convert to uppercase: `shout := toupper(&amp;quot;help!&amp;quot;); // == &amp;quot;HELP!&amp;quot;`&lt;br /&gt;
- **[tolower]** - Convert to lowercase: `answer := tolower(argument); if (answer == &amp;quot;yes&amp;quot;) { sendtext(&amp;quot;Great!&amp;quot;, self); }`&lt;br /&gt;
- **[strncmp]** - Compare with length limit: `if (strncmp(&amp;quot;hello&amp;quot;, &amp;quot;help&amp;quot;, 3) == 0) { sendtext(&amp;quot;Strings match for first 3 chars.&amp;quot;, self); }`&lt;br /&gt;
- **[mid]** - Extract substring: `weapon_type := mid(&amp;quot;longsword +2 of fire&amp;quot;, 1, 9); // == &amp;quot;longsword&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
### Stringlist Processing&lt;br /&gt;
- **[addstring]** - Add to list: `mylist := addstring(mylist, &amp;quot;new_item&amp;quot;); // Add item to list`&lt;br /&gt;
- **[substring]** - Remove from stringlist: `sl:={&amp;quot;hello&amp;quot;,&amp;quot;world&amp;quot;}; substring(sl, &amp;quot;world&amp;quot;) // sl now only contains &amp;quot;hello&amp;quot;`&lt;br /&gt;
- **[in]** - Stringlist membership: `if (&amp;quot;fox&amp;quot; in {&amp;quot;hello&amp;quot;, &amp;quot;fox&amp;quot;}) { /* found substring */ }`&lt;br /&gt;
- **[split]** - Split into stringlist: `words := split(&amp;quot;hello world this is a test&amp;quot;, &amp;quot; &amp;quot;);`&lt;br /&gt;
- **[getwords]** - Get stringlist: `sl := getwords(&amp;quot;hello world&amp;quot;); // sl is {&amp;quot;hello&amp;quot;, &amp;quot;world&amp;quot;}, original preserved`&lt;br /&gt;
&lt;br /&gt;
### Extra Description Functions&lt;br /&gt;
- **[addextra]** - Add descriptions: `addextra(item, 0, &amp;quot;A finely crafted sword with ancient runes.&amp;quot;); // Add main description`&lt;br /&gt;
- **[delstr]** - Delete string files: `if (delstr(&amp;quot;news.txt&amp;quot;)) { sendtext(&amp;quot;News file deleted.&amp;quot;, self); }`&lt;br /&gt;
- **[extra]** - .extra field: `desc := item.extra.descr; // Get extra description text`&lt;br /&gt;
- **[extraptr]** - Extra description pointer: `ex := self.extra; if (ex != null) { sendtext(&amp;quot;Found: &amp;quot; + ex.descr, self); }`&lt;br /&gt;
- **[loadstr]** - File operations: `result := loadstr(&amp;quot;news.txt&amp;quot;, content); if (result &amp;gt; 0) { sendtext(content, self); }`&lt;br /&gt;
- **[savestr]** - File operations: `result := savestr(&amp;quot;news.txt&amp;quot;, message, &amp;quot;w&amp;quot;); if (result &amp;gt; 0) { sendtext(&amp;quot;News saved!&amp;quot;, self); }`&lt;br /&gt;
- **[subextra]** - Remove extra descriptions: `subextra(item.extra, &amp;quot;quest_marker&amp;quot;); // Remove quest marker from item`&lt;br /&gt;
- **[vals]** - Extra values: `total := extra.vals.[0] + extra.vals.[1]; // Sum numeric values from extra description`&lt;br /&gt;
&lt;br /&gt;
**⚠️ Critical Notes:**&lt;br /&gt;
- Stringlists use dot notation: `words.[0]` NOT `words[0]`&lt;br /&gt;
- Convert integers for concatenation: `&amp;quot;Value: &amp;quot; + itoa(num)`&lt;br /&gt;
- substring() removes from stringlists, doesn't extract substrings&lt;br /&gt;
&lt;br /&gt;
## 💬 **Communication System**&lt;br /&gt;
&lt;br /&gt;
### Communication Functions&lt;br /&gt;
- **[sendtext]** - Basic messaging: `sendtext(&amp;quot;Hello, &amp;quot; + player_name + &amp;quot;!&amp;quot;, target); // Send formatted text to specific player`&lt;br /&gt;
- **[pagestring]** - Paginated output: `pagestring(&amp;quot;a very long string will be paged...&amp;quot;, self);`&lt;br /&gt;
- **[prompt]** - User interface: `self.prompt := &amp;quot;[%n%h/%Hhp %m/%M]&amp;gt; &amp;quot;; // Set custom prompt with health/mana display`&lt;br /&gt;
- **[act]** - Message formatting: `act(&amp;quot;You hit $3n for $2d damage!&amp;quot;, A_ALWAYS, self, null, victim, damage, TO_CHAR);`&lt;br /&gt;
- **[sact]** - String formatting: `desc := sact(&amp;quot;$1n is standing here.&amp;quot;, A_SOMEONE, target, null, null, TO_CHAR); // Format message as string`&lt;br /&gt;
- **[textformat]** - Format text: `formatted := textformat(&amp;quot;&amp;amp;nHello &amp;amp;y&amp;quot; + self.name + &amp;quot;&amp;amp;nWelcome!&amp;quot;); // Format with escape codes`&lt;br /&gt;
&lt;br /&gt;
## ⚔️ **Combat System**&lt;br /&gt;
&lt;br /&gt;
### Combat Functions&lt;br /&gt;
- **[set_fighting]** - Set combat: `set_fighting(self, intruder); // Start fighting intruder`&lt;br /&gt;
- **[stop_fighting]** - Stop combat: `stop_fighting(self, null); // Stop all combat`&lt;br /&gt;
- **[attack_type]** - Combat data: `current_attack := self.attack_type; sendtext(&amp;quot;Your current attack type is: &amp;quot; + weapon_name(current_attack), self);`&lt;br /&gt;
- **[weapon_info]** - Combat data: `wpn_info := weapon_info(WPN_SWORD); if (wpn_info.[0] == 2) { sendtext(&amp;quot;Two-handed weapon&amp;quot;, self); }`&lt;br /&gt;
- **[weapon_name]** - Combat data: `name := weapon_name(WPN_SWORD); sendtext(&amp;quot;Weapon type: &amp;quot; + name, self);`&lt;br /&gt;
- **[meleeattack]** - Attack actions: `damage := meleeattack(self, victim, 0, 0, TRUE); if (damage &amp;gt; 0) { act(&amp;quot;You hit $1n for $2d damage!&amp;quot;, A_ALWAYS, self, victim, damage, TO_CHAR); }`&lt;br /&gt;
- **[attack_spell]** - Attack actions: `damage := attack_spell(SPL_FIREBALL, caster, target, 0, &amp;quot;&amp;quot;); if (damage &amp;gt; 0) { act(&amp;quot;Your fireball deals &amp;quot; + itoa(damage) + &amp;quot; damage!&amp;quot;, A_ALWAYS, caster, null, target, damage, TO_CHAR); }`&lt;br /&gt;
- **[cast_spell]** - Spell casting: `damage := cast_spell(SPL_FIREBALL, self, self, target, 0, &amp;quot;&amp;quot;); if (damage &amp;gt; 0) { send(&amp;quot;Fireball deals &amp;quot; + itoa(damage) + &amp;quot; damage!&amp;quot;, self); }`&lt;br /&gt;
- **[meleedamage]** - Combat calculations: `damage := meleedamage(attacker, 50); // Calculate melee damage with base 50`&lt;br /&gt;
- **[defensive]** - Combat calculations: `defense_bonus := defender.defensive - attacker.defensive; if (defense_bonus &amp;gt; 50) { act(&amp;quot;Superior defense!&amp;quot;, A_ALWAYS, defender, null, null, TO_CHAR); }`&lt;br /&gt;
- **[offensive]** - Combat calculations: `off_bonus := target.offensive - attacker.offensive; if (off_bonus &amp;gt; 20) { act(&amp;quot;Significant offensive advantage!&amp;quot;, A_ALWAYS, attacker, null, null, TO_CHAR); }`&lt;br /&gt;
- **[change_speed]** - Combat timing: `change_speed(target, 12); // Delay target's next combat action by 12 pulses`&lt;br /&gt;
&lt;br /&gt;
## ✨ **Affects &amp;amp; Magic System**&lt;br /&gt;
&lt;br /&gt;
### Affect Functions&lt;br /&gt;
- **[addaff]** - Add affects: `addaff(player, ID_SANCTUARY, -1, 0, 0, 0, 0, 0, APF_DURATION | APF_FIRST, 0); // Permanent sanctuary`&lt;br /&gt;
- **[isaff]** - Check affects: `if (isaff(player, ID_BLIND)) { send(&amp;quot;You are blind!&amp;quot;, player); }`&lt;br /&gt;
- **[getaffects]** - Get all affects: `affects := getaffects(player); // Get list of all active affects`&lt;br /&gt;
- **[subaff]** - Remove affects: `subaff(player, ID_BLIND); // Remove blindness affect from player`&lt;br /&gt;
&lt;br /&gt;
## 💰 **Economic System**&lt;br /&gt;
&lt;br /&gt;
### Money Management&lt;br /&gt;
- **[purse]** - Character money: `gold := purse(player, GOLD_PIECE); if (gold &amp;gt;= 100) { sendtext(&amp;quot;You have enough gold!&amp;quot;, player); }`&lt;br /&gt;
- **[transfermoney]** - Money operations: `success := transfermoney(buyer, seller, 1000); // Transfer 1000 coins`&lt;br /&gt;
- **[moneystring]** - Money operations: `price := moneystring(2500, 1); // &amp;quot;25 gold pieces&amp;quot; or &amp;quot;25 gp&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
## ⏰ **Time &amp;amp; Calendar**&lt;br /&gt;
&lt;br /&gt;
### Time Functions&lt;br /&gt;
- **[mudhour]** - Game time: `hour := mudhour(); if (hour &amp;gt;= 6 and hour &amp;lt; 18) { sendtext(&amp;quot;Shop is open!&amp;quot;, self); }`&lt;br /&gt;
- **[mudday]** - Game time: `h := mudhour(); d := mudday(); m := mudmonth(); y := mudyear();`&lt;br /&gt;
- **[mudmonth]** - Game time: `h := mudhour(); d := mudday(); m := mudmonth(); y := mudyear();`&lt;br /&gt;
- **[mudyear]** - Game time: `h := mudhour(); d := mudday(); m := mudmonth(); y := mudyear();`&lt;br /&gt;
- **[asctime]** - Format time string: `time_str := asctime(); // &amp;quot;Mon Dec  5 12:34:56 2025&amp;quot;`&lt;br /&gt;
- **[realtime]** - Real time: `start_time := realtime(); // Record start time in seconds`&lt;br /&gt;
- **[weather]** - Weather conditions: `if (weather == SKY_CLOUDLESS) { sendtext(&amp;quot;Clear skies today!&amp;quot;, self); }`&lt;br /&gt;
- **[wait]** - Time control: `wait(SFB_CMD, command(&amp;quot;hello&amp;quot;)); // Wait for &amp;quot;hello&amp;quot; command`&lt;br /&gt;
- **[sleep]** - Sleep control: `sleep; // Put unit to sleep`&lt;br /&gt;
&lt;br /&gt;
## 🛠️ **Utility Functions**&lt;br /&gt;
&lt;br /&gt;
### Mathematics&lt;br /&gt;
- **[rnd]** - Random number: `num := rnd(1, 100); // Random 1-100`&lt;br /&gt;
- **[openroll]** - Open roll: `roll := openroll(100, 5); // Open-ended 1-100 roll with 5% continuation chance`&lt;br /&gt;
- **[max]** - Maximum: `result := max(a, b); // Larger of two numbers`&lt;br /&gt;
- **[min]** - Minimum: `result := min(a, b); // Smaller of two numbers`&lt;br /&gt;
- **[skill_name]** - Get skill name: `name := skill_name(SKI_SWORD); sendtext(&amp;quot;Skill: &amp;quot; + name, self);`&lt;br /&gt;
- **[spellindex]** - Find spell index: `idx := spellindex(&amp;quot;fireball&amp;quot;); if (idx != -1) { cast_spell(idx, self, self, target, 0, &amp;quot;&amp;quot;); }`&lt;br /&gt;
- **[spellinfo]** - Get spell details: `name := spellinfo(idx, realm, sphere, mana, off, resist, med, targ); sendtext(&amp;quot;Spell: &amp;quot; + name + &amp;quot; (Mana: &amp;quot; + itoa(mana) + &amp;quot;)&amp;quot;, self); }`&lt;br /&gt;
- **[strdir]** - List DIL files: `files := strdir(&amp;quot;spell_*&amp;quot;); foreach (file in files) { sendtext(&amp;quot;Found: &amp;quot; + file + &amp;quot;.dil&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### System Utilities&lt;br /&gt;
- **[log]** - Logging: `log(&amp;quot;Player &amp;quot; + self.name + &amp;quot; completed quest at &amp;quot; + asctime());`&lt;br /&gt;
- **[flog]** - File logging: `flog(&amp;quot;quests.log&amp;quot;, self.name + &amp;quot; completed quest: &amp;quot; + quest_name, &amp;quot;a&amp;quot;);`&lt;br /&gt;
- **[logcrime]** - Crime logging: `logcrime(thief, victim, CRIME_STEALING);`&lt;br /&gt;
- **[info]** - Player info: `email_expd := &amp;quot;$email&amp;quot; in pc.info; if (email_expd != null) email := email_expd.descr;`&lt;br /&gt;
- **[hasfunc]** - Function check: `if (item.hasfunc == 1) { act(&amp;quot;$1n has special powers.&amp;quot;, A_ALWAYS, item, null, null, TO_ROOM); }`&lt;br /&gt;
- **[access]** - Access control: `if (access(player, restricted_zone) &amp;gt;= 3) { sendtext(&amp;quot;Access granted!&amp;quot;, player); }`&lt;br /&gt;
- **[reboot]** - System restart: `act(&amp;quot;Rebooting MUD now...&amp;quot;, A_ALWAYS, self, null, null, TO_ALL); reboot(0);`&lt;br /&gt;
- **[dispatch]** - External messaging: `dispatch(&amp;quot;discord msg #bugs @&amp;quot; + self.name + &amp;quot; bug report: &amp;quot; + report_text); // Send to external dispatcher`&lt;br /&gt;
- **[gamestate]** - Player state: `gamestate(player, GS_MENU); // Put player in menu mode`&lt;br /&gt;
- **[getcmd]** - Command lookup: `cmd := getcmd(&amp;quot;say&amp;quot;); if (cmd) { sendtext(&amp;quot;Command level: &amp;quot; + itoa(cmd.level), self); }`&lt;br /&gt;
- **[getinteger]** - System values: `mana_reg := getinteger(DIL_GINT_MANAREG, player, 0); // Get mana regen rate`&lt;br /&gt;
- **[loglevel]** - Command logging: `cmd := getcommand(&amp;quot;kick&amp;quot;); if (cmd.loglevel &amp;gt; 0) { sendtext(&amp;quot;Command logs at level &amp;quot; + cmd.loglevel, self); }`&lt;br /&gt;
&lt;br /&gt;
## 📋 **Unit Operations**&lt;br /&gt;
&lt;br /&gt;
### Finding &amp;amp; Managing Units&lt;br /&gt;
- **[findunit]** - Unit search: `target := findunit(self, &amp;quot;sword&amp;quot;, FIND_UNIT_INVEN, null); // Find sword in inventory`&lt;br /&gt;
- **[findsymbolic]** - Unit search: `target := findsymbolic(&amp;quot;sword@midgaard&amp;quot;); if (target != null) { act(&amp;quot;Found: $1n&amp;quot;, A_ALWAYS, self, target, null, TO_CHAR); }`&lt;br /&gt;
- **[findrndunit]** - Unit search: `random_pc := findrndunit(self, FIND_UNIT_ZONE, UNIT_ST_PC); if (random_pc != null) { act(&amp;quot;Random player: $1n&amp;quot;, A_ALWAYS, self, random_pc, null, TO_CHAR); }`&lt;br /&gt;
- **[target]** - Symbolic search: `guard := target(&amp;quot;guard@midgaard&amp;quot;); if (guard) { sendtext(&amp;quot;Found guard: &amp;quot; + guard.name, self); }`&lt;br /&gt;
- **[symname]** - Get symbolic name: `sym := symname(target); if (sym != &amp;quot;&amp;quot;) { sendtext(&amp;quot;Symbolic name: &amp;quot; + sym, self); }`&lt;br /&gt;
- **[unitdir]** - File search: `files := unitdir(&amp;quot;corpse*&amp;quot;); // Find all corpse files in units directory`&lt;br /&gt;
- **[visible]** - Visibility check: `if (visible(self, target)) { sendtext(&amp;quot;You can see &amp;quot; + target.name, self); }`&lt;br /&gt;
- **[load]** - Unit creation: `item := load(&amp;quot;sword@midgaard&amp;quot;); if (item != null) { link(item, self); act(&amp;quot;Item created!&amp;quot;, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[delunit]** - Unit lifecycle: `if (delunit(&amp;quot;temp_guardian.unit&amp;quot;)) { act(&amp;quot;Temporary unit deleted.&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[destroy]** - Unit lifecycle: `item := findunit(self, &amp;quot;sword&amp;quot;, FIND_UNIT_IN_ME, null); if (item) { destroy(item); act(&amp;quot;Item destroyed!&amp;quot;, self, null, null, TO_CHAR); }`&lt;br /&gt;
- **[clone]** - Unit lifecycle: `copy := clone(original_item); if (copy != null) { link(copy, self); }`&lt;br /&gt;
- **[getfollower]** - Follower access: `follower := getfollower(leader, 0); // Get first follower`&lt;br /&gt;
- **[getopponent]** - Opponent access: `opponent := getopponent(character, 0); // Get first opponent`&lt;br /&gt;
&lt;br /&gt;
### Unit Validation&lt;br /&gt;
- **[can_carry]** - Carry validation: `result := can_carry(player, item, 1); if (result == 0) { /* can carry */ }`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### Finding &amp;amp; Managing Rooms&lt;br /&gt;
- **[findroom]** - Room operations: `room := findroom(&amp;quot;temple@midgaard&amp;quot;); if (room != null) { link(self, room); }`&lt;br /&gt;
- **[pathto]** - Room operations: `direction := pathto(self, target_room); // Get direction to target`&lt;br /&gt;
- **[setroomexit]** - Room connections: `setroomexit(room, DIR_NORTH, target_room); // Create north exit`&lt;br /&gt;
- **[lastroom]** - Previous location: `prev_room := lastroom(player); if (prev_room) { sendtext(&amp;quot;You came from: &amp;quot; + prev_room.name, player); }`&lt;br /&gt;
&lt;br /&gt;
### Object Management&lt;br /&gt;
- **[equip]** - Get Equipment: `weapon := equip(self, WEAR_HANDS); if (weapon != null) { sendtext(&amp;quot;Wielding: &amp;quot; + weapon.name, self); }`&lt;br /&gt;
- **[unequip]** - Remove Equipment: `weapon := equipment(self, WEAR_WIELD); if (weapon != null) { unequip(weapon); act(&amp;quot;You unequip &amp;quot; + weapon.title, A_ALWAYS, self, null, null, TO_CHAR); }` &lt;br /&gt;
- **[equipment]** - Check Equipment: `weapon := equipment(player, WEAR_WIELD); if (weapon != null) { send(&amp;quot;You are wielding &amp;quot; + weapon.name, player); } else { send(&amp;quot;You are not wielding anything.&amp;quot;, player); }`&lt;br /&gt;
- **[addequip]** - Add Equipment: `ring := load(&amp;quot;ring@midgaard&amp;quot;); if (ring != null) { addequip(ring, WEAR_FINGER_L); }`&lt;br /&gt;
- **[fits]** - Equipment validation: `reason := fits(player, armor, -1); if (reason != &amp;quot;&amp;quot;) { sendtext(&amp;quot;Armor doesn't fit: &amp;quot; + reason, player); }`&lt;br /&gt;
&lt;br /&gt;
### Movement &amp;amp; Linking &amp;amp; Lighting&lt;br /&gt;
- **[link]** - Unit positioning: `link(item, player); // Move item to player's inventory`&lt;br /&gt;
- **[remove]** - Inventory management: `remove(mylist, 2); // Remove element at index 2`&lt;br /&gt;
- **[insert]** - Inventory management: `insert(mylist, 1, &amp;quot;new_item&amp;quot;); // Insert at position 1`&lt;br /&gt;
- **[islight]** - Lighting: `if (islight(self)) { sendtext(&amp;quot;This item provides light.&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## 🎭 **DIL Program Management**&lt;br /&gt;
&lt;br /&gt;
### Program Structure&lt;br /&gt;
- **[dilbegin]** - Program definition: `dilbegin my_function(param : string);`&lt;br /&gt;
- **[var]** - Variable declaration: `dilbegin f(); var i : integer; name : string; code { /* program logic here */ } dilend`&lt;br /&gt;
- **[external]** - External function: `dilbegin f(); external integer my_func@function(u : unitptr); code { /* program logic here */ } dilend`&lt;br /&gt;
- **[code]** - Code block: `dilbegin f(); code { /* program logic here */ } dilend`&lt;br /&gt;
- **[dilend]** - Program definition: `} dilend`&lt;br /&gt;
&lt;br /&gt;
### Program Control&lt;br /&gt;
- **[priority]** - Execution control: `priority; // Block other DIL programs until nopriority called`&lt;br /&gt;
- **[nopriority]** - Execution control: `nopriority(); // Allow other DIL programs to execute again`&lt;br /&gt;
- **[waitnoop]** - Program flow: `waitnoop; // Temporarily release secure constraints for command execution`&lt;br /&gt;
&lt;br /&gt;
### Event Handling&lt;br /&gt;
- **[secure]** - Security control: `secure(victim, victim_fled); // Jump to victim_fled: if target disappears`&lt;br /&gt;
- **[unsecure]** - Security control: `secure(item, :item_lost); // Process item safely; unsecure(item); // Remove protection when done` &lt;br /&gt;
- **[on_activation]** - Event handlers: `on_activation((self.position &amp;lt;= POSITION_SLEEPING) or (self.position == POSITION_FIGHTING), skip); // Skip if asleep or fighting`&lt;br /&gt;
- **[interrupt]** - Program flow: `intr_id := interrupt(SFB_MSG, argument == &amp;quot;help&amp;quot;, help_handler); // Handle help requests`&lt;br /&gt;
- **[clear]** - Program flow: `clear(intridx); // Remove interrupt handler by index`&lt;br /&gt;
&lt;br /&gt;
### DIL Operations&lt;br /&gt;
- **[dilcall]** - Program management: `success := dilcall(&amp;quot;heal_spell&amp;quot;, self, 0, &amp;quot;minor&amp;quot;); // Call DIL template`&lt;br /&gt;
- **[dilfind]** - Program management: `if (dilfind(&amp;quot;quest_active&amp;quot;, player)) { sendtext(&amp;quot;Quest already in progress.&amp;quot;, self); }`&lt;br /&gt;
- **[dilcopy]** - Program management: `new_prog := dilcopy(&amp;quot;guard_ai&amp;quot;, self); // Create guard AI instance`&lt;br /&gt;
- **[dildestroy]** - Program management: `count := dildestroy(&amp;quot;temp_effect&amp;quot;, self); // Remove temporary effect`&lt;br /&gt;
- **[sendtoalldil]** - Inter-program communication: `sendtoalldil(&amp;quot;SYSTEM: Reboot in 5 minutes!&amp;quot;, &amp;quot;admin_*&amp;quot;); // Alert all admins`&lt;br /&gt;
- **[store]** - Inter-program communication: `store(chest, &amp;quot;chest_backup.&amp;quot; + chest.zoneidx, TRUE); // Save chest and contents`&lt;br /&gt;
- **[restore]** - Unit restoration: `item := restore(&amp;quot;saved_item&amp;quot;, null); if (item != null) { link(item, self); }`&lt;br /&gt;
&lt;br /&gt;
### DIL Message Functions&lt;br /&gt;
- **[send]** - Inter-program messaging: `send(&amp;quot;task_complete&amp;quot;); pause; send(&amp;quot;cleanup_ready&amp;quot;); // Send to waiting DIL programs with SFB_MSG`&lt;br /&gt;
- **[send_done]** - Completion messages: `send_done(&amp;quot;cast&amp;quot;, self, null, target, 1, &amp;quot;fireball&amp;quot;, null, 0); // Notify spell completion`&lt;br /&gt;
- **[send_pre]** - Preparation messages: `result := send_pre(&amp;quot;cast&amp;quot;, self, null, target, 1, &amp;quot;fireball&amp;quot;, null, 0); if (result == SFR_BLOCK) { sendtext(&amp;quot;Spell blocked!&amp;quot;, self); }`&lt;br /&gt;
- **[sendto]** - Basic messaging: `sendto(&amp;quot;The sword glows with ancient power.&amp;quot;, self); // Send to all DIL programs within a unit`&lt;br /&gt;
- **[sendtoall]** - Broadcast functions: `sendtoall(&amp;quot;SYSTEM SHUTDOWN IN 10 MINUTES!&amp;quot;, &amp;quot;sys_control&amp;quot;); // Send to all matching DIL programs globally`&lt;br /&gt;
- **[sendtoalldil]** - Broadcast functions: `sendtoall(&amp;quot;NEW SPELL AVAILABLE: fireball&amp;quot;, &amp;quot;spell_*&amp;quot;); // Send to specific DIL programs by pattern`&lt;br /&gt;
&lt;br /&gt;
### PC multi-line editing function&lt;br /&gt;
- **[beginedit]** - Start editing mode: `beginedit(self); wait(SFB_EDIT, self == activator); // Get edited text in argument`&lt;br /&gt;
- **[killedit]** - Force exit editing: `killedit(self); // Stop editing session immediately`&lt;br /&gt;
- **[editing]** - Check editing status: `if (self.editing) { sendtext(&amp;quot;Already editing!&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Development Tools&lt;br /&gt;
- **[shell]** - Execute system command: `result := shell(&amp;quot;backup_script.sh&amp;quot;); // Returns 0 if thread created`&lt;br /&gt;
- **[exec]** - Execute a command: `exec(&amp;quot;say Hello there!&amp;quot;, target); // Force target char to speak`&lt;br /&gt;
&lt;br /&gt;
## 🌍 **World Management**&lt;br /&gt;
&lt;br /&gt;
### Zone management&lt;br /&gt;
- **[findzone]** - Zone operations: `zone := findzone(&amp;quot;midgaard&amp;quot;); if (zone != null) { sendtext(&amp;quot;Found zone: &amp;quot; + zone.name, self); }`&lt;br /&gt;
- **[zoneidx]** - Zone properties: `unit_id := self.zoneidx; // Returns &amp;quot;name@zone&amp;quot; format`&lt;br /&gt;
- **[loadlevel]** - Zone restrictions: `if (self.level &amp;lt; zone.loadlevel) { sendtext(&amp;quot;Zone requires level &amp;quot; + zone.loadlevel, self); }`&lt;br /&gt;
- **[resetmode]** - Zone properties: `mode := zone.resetmode; // Get zone reset mode (read-only)`&lt;br /&gt;
- **[resettime]** - Zone properties: `zone.resettime := 30; // Set reset interval to 30 minutes`&lt;br /&gt;
- **[zonereset]** - Zone resets: `zonereset(zone); // Reset all NPCs and objects in zone`&lt;br /&gt;
- **[help]** - Zone information: `target_zone := findzone(zone_name); help_text := target_zone.help; act(help_text, A_ALWAYS, self, null, null, TO_CHAR);`&lt;br /&gt;
- **[roomcount]** - Zone properties: `count := zone.roomcount; // Get number of rooms in zone`&lt;br /&gt;
- **[rooms]** - Zone properties: `room := zone.rooms; while (room) { sendtext(room.name, self); room := room.next; }`&lt;br /&gt;
- **[npcs]** - Zone properties: `npc := npcs(zone); while (npc) { sendtext(npc.name, self); npc := npc.next; }`&lt;br /&gt;
- **[npccount]** - Zone properties: `count := npccount(zone); // Get number of NPCs in zone`&lt;br /&gt;
- **[objs]** - Field Object operations: `zone := findzone(&amp;quot;midgaard&amp;quot;); first_obj := zone.objs; while (first_obj != null) { act(&amp;quot;Zone object: $1n&amp;quot;, A_ALWAYS, self, first_obj, null, TO_CHAR); first_obj := first_obj.next; }`&lt;br /&gt;
- **[objcount]** - Object operations: `zone := findzone(&amp;quot;midgaard&amp;quot;); count := zone.objcount; act(&amp;quot;Zone has $1d objects&amp;quot;, A_ALWAYS, self, count, null, TO_CHAR);`&lt;br /&gt;
- **[creators]** - Zone authors: `if (zone.creators) { foreach (name in zone.creators) { act(&amp;quot;Creator: &amp;quot; + name, self); } }`&lt;br /&gt;
- **[fname]** - Zone filename: `zone_file := zone.fname; sendtext(&amp;quot;Zone file: &amp;quot; + zone_file, self);`&lt;br /&gt;
- **[notes]** - Zone documentation: `zone.notes := &amp;quot;Administrative zone - restricted access&amp;quot;; // Set zone notes`&lt;br /&gt;
&lt;br /&gt;
### List management&lt;br /&gt;
- **[global_head]** - Inter-program communication: `first_unit := global_head(); // Get first unit in global list`&lt;br /&gt;
- **[room_head]** - Room operations: `room := room_head(); while (room) { sendtext(room.name, self); room := room.next; }`&lt;br /&gt;
- **[obj_head]** - Object operations: `first_obj := obj_head(); while (first_obj != null) { act(&amp;quot;Object: $1n&amp;quot;, A_ALWAYS, self, first_obj, null, TO_CHAR); first_obj := first_obj.next; }`&lt;br /&gt;
- **[pc_head]** - PC operations: &lt;br /&gt;
- **[npc_head]** - NPC operations: `npc := npc_head(); while (npc) { sendtext(npc.name, self); npc := npc.next; }`&lt;br /&gt;
- **[zone_head]** - Zone operations: `first_zone := zone_head(); // Get first zone in global list`&lt;br /&gt;
- **[zhead]** - Zone operations: `zone := zhead(); while (zone) { sendtext(zone.name, self); zone := zone.next; }`&lt;br /&gt;
- **[chead]** - Command operations: `cmd := chead(); while (cmd) { act(&amp;quot;Command: &amp;quot; + cmd.name, A_ALWAYS, self, null, null, TO_CHAR); cmd := cmd.next; }`&lt;br /&gt;
- **[command_head]** - Command list: `cmd := command_head(); while (cmd) { act(&amp;quot;Found: &amp;quot; + cmd.name, self); cmd := cmd.next; }`&lt;br /&gt;
- **[ghead]** - Global list: `unit := ghead(); while (unit) { sendtext(unit.name, self); unit := unit.gnext; }` &lt;br /&gt;
&lt;br /&gt;
#### List Operations&lt;br /&gt;
- **[next]** - Next element: `item := item.next; // Move to next item in list`&lt;br /&gt;
- **[gnext]** - Global next: `unit := unit.gnext; // Move to next unit in global list`&lt;br /&gt;
- **[gprevious]** - Previous element: `prev_unit := unit.gprevious; // Get previous unit in global list`&lt;br /&gt;
&lt;br /&gt;
## 🔐 **Security &amp;amp; Validation**&lt;br /&gt;
&lt;br /&gt;
### Security Functions&lt;br /&gt;
- **[check_password]** - Account management: `if (check_password(player, argument)) { send(&amp;quot;Password verified.&amp;quot;, player); } else { send(&amp;quot;Invalid password.&amp;quot;, player); }`&lt;br /&gt;
- **[set_password]** - Account management: `set_password(player, &amp;quot;newpass123&amp;quot;); // Change player password`&lt;br /&gt;
- **[delete_player]** - Account management: `if (isplayer(&amp;quot;troublemaker&amp;quot;)) { delete_player(&amp;quot;troublemaker&amp;quot;); }`&lt;br /&gt;
- **[access]** - Security control: `if (access(player, restricted_zone) &amp;gt;= 3) { sendtext(&amp;quot;Access granted!&amp;quot;, player); }`&lt;br /&gt;
- **[isplayer]** - Player validation: `if (not isplayer(player_name)) { sendtext(&amp;quot;Player not found.&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### God Functions&lt;br /&gt;
- **[switch]** - Character control: `switch(self, target); sendtext(&amp;quot;You have switched to &amp;quot; + target.name + &amp;quot;.&amp;quot;, self);`&lt;br /&gt;
&lt;br /&gt;
### Pay to Play functions (not in use)&lt;br /&gt;
- **[paycheck]** - Character money: `if (paycheck(shop_room, player)) { sendtext(&amp;quot;Access granted!&amp;quot;, player); }`&lt;br /&gt;
- **[acc_balance]** - Bank accounts: `balance := player.acc_balance; if (balance &amp;gt;= 10000) { sendtext(&amp;quot;You have $100+ in your account!&amp;quot;, player); }`&lt;br /&gt;
- **[acc_total]** - Bank accounts: `total_credit := player.acc_total; if (total_credit &amp;gt;= 50000) { sendtext(&amp;quot;Premium account!&amp;quot;, player); }`&lt;br /&gt;
- **[acc_modify]** - Bank accounts: `acc_modify(player, -5000); // Remove $50 from account`&lt;br /&gt;
- **[payonly]** - Payment status: `if (zone.payonly) { sendtext(&amp;quot;This zone requires payment to access.&amp;quot;, self); }`&lt;br /&gt;
&lt;br /&gt;
### Color Functions (not in use)&lt;br /&gt;
- **[addcolor]** - Add colors: `addcolor(player, &amp;quot;&amp;amp;red&amp;quot;); // Add red to player's color palette`&lt;br /&gt;
- **[delcolor]** - Remove colors: `delcolor(player, &amp;quot;&amp;amp;red&amp;quot;); // Remove red from player's color palette`&lt;br /&gt;
- **[changecolor]** - Modify colors: `if (changecolor(player, &amp;quot;clan_color&amp;quot;, &amp;quot;&amp;amp;c+w&amp;amp;bn&amp;quot;)) { send(&amp;quot;Clan color updated!&amp;quot;, player); }`&lt;br /&gt;
- **[getcolor]** - Color processing: `processed := getcolor(&amp;quot;&amp;amp;brBold red text&amp;amp;n&amp;quot;); // Process color codes`&lt;br /&gt;
&lt;br /&gt;
## 🏷️ **Constants &amp;amp; Types** (vme/include/vme.h and vme/include/values.h)&lt;br /&gt;
&lt;br /&gt;
### SFB&lt;br /&gt;
## 🏷️ **Constants &amp;amp; Types** (vme/include/vme.h and vme/include/values.h)&lt;br /&gt;
These are #define constants from the source headers. Use them in DIL for flags, types, etc. (e.g., `if (self.type == UNIT_ST_PC)`). Values are numeric; descriptions are based on code comments/context.&lt;br /&gt;
&lt;br /&gt;
### State Function Bits (SFB_*)&lt;br /&gt;
Used in wait(), interrupt(), etc., for event triggers.&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| SFB_CMD  | Normal command trigger. |&lt;br /&gt;
| SFB_TICK | Tick-message trigger.   |&lt;br /&gt;
| SFB_DEAD | Death-message trigger. |&lt;br /&gt;
| SFB_COM  | Combat-event trigger. |&lt;br /&gt;
| SFB_MSG  | Message-event trigger. |&lt;br /&gt;
| SFB_SAVE | Save-event trigger. |&lt;br /&gt;
| SFB_DONE | Indicates something has been done. |&lt;br /&gt;
| SFB_ALL  | (SFB_CMD \| SFB_TICK \| SFB_DEAD \| SFB_COM \| SFB_MSG \| SFB_SAVE) | All common triggers. |&lt;br /&gt;
&lt;br /&gt;
### Unit Types (UNIT_ST_*)&lt;br /&gt;
For unit.type checks (e.g., in findunit()).&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| UNIT_ST_NPC | Non-player character. |&lt;br /&gt;
| UNIT_ST_PC | Player character. |&lt;br /&gt;
| UNIT_ST_ROOM | Room. |&lt;br /&gt;
| UNIT_ST_OBJ | Object. |&lt;br /&gt;
&lt;br /&gt;
### Positions (POSITION_*)&lt;br /&gt;
For char.position, defaultpos, etc.&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| POSITION_DEAD Dead (use corpse). |&lt;br /&gt;
| POSITION_MORTALLYW | Mortally wounded. |&lt;br /&gt;
| POSITION_INCAP | Incapacitated. |&lt;br /&gt;
| POSITION_STUNNED | Stunned. |&lt;br /&gt;
| POSITION_SLEEPING | Sleeping. |&lt;br /&gt;
| POSITION_RESTING | Resting. |&lt;br /&gt;
| POSITION_SITTING | Sitting. |&lt;br /&gt;
| POSITION_FIGHTING | Fighting (do not set manually). |&lt;br /&gt;
| POSITION_STANDING | Standing. |&lt;br /&gt;
&lt;br /&gt;
### Character Flags (CHAR_*)&lt;br /&gt;
For char.charflags.&lt;br /&gt;
&lt;br /&gt;
| Constant |  Description |&lt;br /&gt;
|----------|--------------|&lt;br /&gt;
| CHAR_PROTECTED | Protected by law system. |&lt;br /&gt;
| CHAR_LEGAL_TARGET | Internal (do not use). |&lt;br /&gt;
| CHAR_OUTLAW | Outlaw status (do not use). |&lt;br /&gt;
| CHAR_GROUP | In group (do not use). |&lt;br /&gt;
| CHAR_BLIND | Blinded. |&lt;br /&gt;
| CHAR_HIDE | Hidden. |&lt;br /&gt;
| CHAR_MUTE | Mute. |&lt;br /&gt;
| CHAR_SNEAK | Sneaking. |&lt;br /&gt;
| CHAR_DETECT_ALIGN | Detect alignment (PCs only). |&lt;br /&gt;
| CHAR_DETECT_INVISIBLE | See invisible. |&lt;br /&gt;
| CHAR_DETECT_MAGIC | Detect magic (PCs only). |&lt;br /&gt;
| CHAR_DETECT_POISON | Detect poison (PCs only). |&lt;br /&gt;
| CHAR_DETECT_UNDEAD | Detect undead (PCs only). |&lt;br /&gt;
| CHAR_DETECT_CURSE | Detect curse (PCs only). |&lt;br /&gt;
| CHAR_DETECT_LIFE | Detect life (PCs only). |&lt;br /&gt;
| CHAR_WIMPY | Wimpy mode (flee low HP). |&lt;br /&gt;
| CHAR_SELF_DEFENCE | Internal use (do not use). |&lt;br /&gt;
| CHAR_PEACEFUL | No auto-attack. |&lt;br /&gt;
| CHAR_KILL_SELF | Self-kill detection. |&lt;br /&gt;
&lt;br /&gt;
### Object Flags (OBJ_*)&lt;br /&gt;
For obj.objectflags.&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| OBJ_NO_UNEQUIP |Cannot unequip. |&lt;br /&gt;
| OBJ_TWO_HANDS | Requires two hands. |&lt;br /&gt;
| OBJ_NOCOVER | Doesn't cover body part. |&lt;br /&gt;
| OBJ_NO_DUAL | Cannot dual-wield. |&lt;br /&gt;
| OBJ_VEHICLE | Vehicle type (extended). |&lt;br /&gt;
&lt;br /&gt;
(Truncate for brevity; full list includes OBJ_MAGIC from snippets.)&lt;br /&gt;
&lt;br /&gt;
### Room Flags (ROOM_*)&lt;br /&gt;
For room.roomflags (e.g., UNIT_FL_INDOORS in zone).&lt;br /&gt;
&lt;br /&gt;
| Constant | Description |&lt;br /&gt;
|----------|-------------|&lt;br /&gt;
| UNIT_FL_INDOORS Indoors (no weather). |&lt;br /&gt;
| UNIT_FL_NO_WEATHER | No weather effects. |&lt;br /&gt;
| UNIT_FL_NO_MOB | No mobiles allowed. |&lt;br /&gt;
| ROOM_FL_DARK | Dark&lt;br /&gt;
&lt;br /&gt;
### Flags&lt;br /&gt;
- **[ROOM_*]** - Room flags&lt;br /&gt;
- **[CMD_*]** - Command flags&lt;br /&gt;
- **[SPL_*]** - Spell flags&lt;br /&gt;
- **[SKI_*]** - Skill flags&lt;br /&gt;
- **[ABIL_*]** - Ability flags&lt;br /&gt;
&lt;br /&gt;
### Zone Macros (vme/include/wmacros.h vme/include/monster.h)&lt;br /&gt;
Used in .zon files (e.g., for NPC/object defs). Not directly in DIL, but referenced.&lt;br /&gt;
Easy way to create all kind of standard objects or characters. &lt;br /&gt;
&lt;br /&gt;
| Macro | Expansion/Usage | Description |&lt;br /&gt;
|-------|-----------------|-------------|&lt;br /&gt;
| M_AVG_HUMAN(level, sex) | (Sets height, weight, etc. based on level/sex) | Average human NPC stats. |&lt;br /&gt;
| WEAPON_DEF(wpn_type, def_bonus, att_bonus) | (Sets value[0-4] for weapons) | Defines weapon type/damage. |&lt;br /&gt;
| BONUS_AVERAGE | 0 | Average bonus (use -5 to 5 for poor/excellent). |&lt;br /&gt;
| OUT_DARK_NON_NOON | (Sets outside_descr based on time) | Dark description except noon. |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## 🚨 **Critical Compilation Guidelines**&lt;br /&gt;
&lt;br /&gt;
### Reserved Keywords (⚠️ IMPORTANT)&lt;br /&gt;
The following words are **reserved** in DIL and **cannot be used as variable names**:&lt;br /&gt;
- `opponent` - **Function name, not variable** - use `opp`, `target_unit`, or `target` instead&lt;br /&gt;
- `for` - **Not supported** - use `while` loops instead&lt;br /&gt;
- Other reserved words may exist during compilation&lt;br /&gt;
&lt;br /&gt;
### Variable Naming Conventions&lt;br /&gt;
- **Maximum name length:** 16 characters for unit names&lt;br /&gt;
- **Use descriptive names:** `target_unit` instead of `target`&lt;br /&gt;
- **Use underscores:** `current_room` for readability&lt;br /&gt;
- **Avoid all reserved keywords** listed above&lt;br /&gt;
&lt;br /&gt;
# Common DIL Patterns and templates&lt;br /&gt;
These examples demonstrate common DIL idioms using the language features above. Use them as starting points for your scripts.&lt;br /&gt;
&lt;br /&gt;
- **Infinite Event Loop (NPC AI):**&lt;br /&gt;
```&lt;br /&gt;
  // Skip if NPC is busy&lt;br /&gt;
  on_activation((self.position &amp;lt;= POSITION_SLEEPING) or (self.position == POSITION_FIGHTING), skip);&lt;br /&gt;
:start:&lt;br /&gt;
  wait(SFB_CMD | SFB_MSG, activator.type == UNIT_ST_PC);  // Wait for any command or message from PC&lt;br /&gt;
  if (not visible(self, activator)) // We deal with players we can see&lt;br /&gt;
    goto start;&lt;br /&gt;
  u := activator;&lt;br /&gt;
  secure(u, start); // If pc disappears we jump to start&lt;br /&gt;
  // Handle event... &lt;br /&gt;
:cleanup:&lt;br /&gt;
  unsecure(u);&lt;br /&gt;
  goto start;&lt;br /&gt;
&lt;br /&gt;
- **Secure Target Handling (Prevent Null Pointers):**&lt;br /&gt;
  target := findunit(self, &amp;quot;playername&amp;quot;, FIND_UNIT_SURRO, UNIT_ST_PC);&lt;br /&gt;
  if (target != null) {&lt;br /&gt;
    secure(target, lost_target);&lt;br /&gt;
    // Safe operations on target...&lt;br /&gt;
  }&lt;br /&gt;
  unsecure(target);&lt;br /&gt;
:lost_target:&lt;br /&gt;
  log(&amp;quot;Target lost&amp;quot;);&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Random Decision Tree:**&lt;br /&gt;
```&lt;br /&gt;
chance := rnd(1, 100);&lt;br /&gt;
if (chance &amp;lt;= 30) {&lt;br /&gt;
  // Action 1&lt;br /&gt;
} else if (chance &amp;lt;= 70) {&lt;br /&gt;
  // Action 2&lt;br /&gt;
} else {&lt;br /&gt;
  // Action 3&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
- **Quest Flag Check/Update (Using Extra):**&lt;br /&gt;
if (&amp;quot;rabbit quest ongoing&amp;quot; in activator.quests) {&lt;br /&gt;
  sendtext(&amp;quot;Bring me that skin.&amp;quot;, activator);&lt;br /&gt;
} else if (&amp;quot;rabbit quest complete&amp;quot; in activator.quests) {&lt;br /&gt;
  sendtext(&amp;quot;Quest already complete!&amp;quot;, activator);&lt;br /&gt;
} else {&lt;br /&gt;
   addextra(pc.quests, {&amp;quot;rabbit quest ongoing&amp;quot;}, &amp;quot;kill the killer rabbit&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Coordinated NPC Movement and Event Triggering (Multi-NPC AI):**&lt;br /&gt;
```&lt;br /&gt;
  external&lt;br /&gt;
    integer walk_room@function (s:string,i:integer);  // Import pathfinding function&lt;br /&gt;
  var&lt;br /&gt;
    tf:integer;  // Temp for walk result&lt;br /&gt;
    target_room: string;  // Destination symbolic name&lt;br /&gt;
  code&lt;br /&gt;
  {&lt;br /&gt;
    // Skip if busy or invalid state&lt;br /&gt;
    on_activation((self.position &amp;lt;= POSITION_SLEEPING) or (self.position == POSITION_FIGHTING), skip);&lt;br /&gt;
:start:&lt;br /&gt;
    // Wait for trigger (e.g., message from another DIL)&lt;br /&gt;
    wait(SFB_MSG, argument == &amp;quot;raid_start&amp;quot;);&lt;br /&gt;
    // Move to target with pathfinding&lt;br /&gt;
    target_room := &amp;quot;cabin@haon_dor&amp;quot;;&lt;br /&gt;
    tf := walk_room@function(target_room, 4);  // 4 = speed/mode; adjust as needed&lt;br /&gt;
    if (tf == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
       // Perform action at destination&lt;br /&gt;
       exec(&amp;quot;emote raids the cabin!&amp;quot;, self);&lt;br /&gt;
       pause;&lt;br /&gt;
       // Signal completion to other NPCs/DILs&lt;br /&gt;
       sendto(&amp;quot;raid_complete&amp;quot;, findsymbolic(&amp;quot;orc_chief@haon_dor&amp;quot;));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Return or loop&lt;br /&gt;
    tf := FALSE;&lt;br /&gt;
    while (tf == FALSE)&lt;br /&gt;
      tf := walk_room@function(&amp;quot;orc_cave@haon_dor&amp;quot;, 4);&lt;br /&gt;
    goto start;  // Back to waiting loop&lt;br /&gt;
  }&lt;br /&gt;
  // The orc chief could send a message like this&lt;br /&gt;
  //    sendto(&amp;quot;raid_start&amp;quot;, findsymbolic(&amp;quot;orc1@somezone&amp;quot;));&lt;br /&gt;
```&lt;br /&gt;
- **Advanced pattern for handcuffing player**&lt;br /&gt;
```&lt;br /&gt;
dilbegin cuff_target(deputy : unitptr, targ : unitptr);&lt;br /&gt;
var&lt;br /&gt;
  cuffs : unitptr;&lt;br /&gt;
code {&lt;br /&gt;
  act(&amp;quot;You cuff $3n.&amp;quot;, A_SOMEONE, deputy, null, targ, TO_CHAR);&lt;br /&gt;
  follow(targ, deputy);  // Force target to follow&lt;br /&gt;
  unequip(equipment(targ, WEAR_WRIST_R));  // Remove existing wrist item&lt;br /&gt;
&lt;br /&gt;
  cuffs := load(&amp;quot;cuffs@midgaard&amp;quot;); // Now inside the deputy&lt;br /&gt;
  link(cuffs, targ);     // Move cuffs to target&lt;br /&gt;
  addequip(cuffs, WEAR_WRIST_R);  // Equip cuffs on the char it is .inside&lt;br /&gt;
  dilcopy(&amp;quot;cuffed@midgaard(&amp;quot;+self.name+&amp;quot;)&amp;quot;, targ);  // Apply restraint DIL to cuffs&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Handcuffs blocks all DILs**&lt;br /&gt;
```&lt;br /&gt;
// The person with this DIL can only execute a few commands&lt;br /&gt;
// fnpri is the execution priority of the DIL (the order in which they are executed on events)&lt;br /&gt;
// unique means there can not be a duplicate of this running, only one copy per unit&lt;br /&gt;
// aware means events from the unit itself also trigger events (normally excluded)&lt;br /&gt;
dilbegin fnpri(FN_PRI_RESCUE-2) aware unique cuffed2(depname : string);&lt;br /&gt;
var&lt;br /&gt;
   i      : integer;&lt;br /&gt;
   u      : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   interrupt(SFB_COM, activator == self, broken); // If in combat, stop this&lt;br /&gt;
&lt;br /&gt;
   :loop:&lt;br /&gt;
   wait(SFB_CMD, TRUE);&lt;br /&gt;
&lt;br /&gt;
   :postloop:&lt;br /&gt;
   if (activator == self.master)&lt;br /&gt;
   {&lt;br /&gt;
      if (activator.position &amp;lt; POSITION_STANDING)&lt;br /&gt;
        goto loop;&lt;br /&gt;
&lt;br /&gt;
      /* Do this trickery to allow the cuffed person to follow! */&lt;br /&gt;
&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;
         wait(SFB_CMD, TRUE);&lt;br /&gt;
         if (activator == self)&lt;br /&gt;
         {&lt;br /&gt;
            if (command(&amp;quot;north&amp;quot;) or command(&amp;quot;east&amp;quot;) or&lt;br /&gt;
               command(&amp;quot;south&amp;quot;) or command(&amp;quot;west&amp;quot;) or&lt;br /&gt;
               command(&amp;quot;up&amp;quot;) or command(&amp;quot;down&amp;quot;))&lt;br /&gt;
            {&lt;br /&gt;
               goto loop;&lt;br /&gt;
            }&lt;br /&gt;
         }&lt;br /&gt;
         goto postloop;&lt;br /&gt;
      }&lt;br /&gt;
      goto loop;&lt;br /&gt;
   }&lt;br /&gt;
   else if (activator == self)&lt;br /&gt;
   {&lt;br /&gt;
      if (command(&amp;quot;look&amp;quot;) or command(&amp;quot;say&amp;quot;) or&lt;br /&gt;
          command(&amp;quot;ask&amp;quot;) or command(&amp;quot;tell&amp;quot;))&lt;br /&gt;
        goto loop;&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         block; // Block execution of all other commands&lt;br /&gt;
         act(depname + &amp;quot; prevents you from removing the hand cuffs.&amp;quot;,&lt;br /&gt;
            A_ALWAYS, self, null, null, TO_CHAR);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   goto loop;&lt;br /&gt;
&lt;br /&gt;
   :broken:&lt;br /&gt;
   i := dildestroy(&amp;quot;cuffed@midgaard&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
// Make sure the handcuffs blocks execution of other DILs.&lt;br /&gt;
// So it's one worse priority (-1) than &amp;quot;cuffed2&amp;quot; (-2).&lt;br /&gt;
//  meaning cuffed2 will run, and cuffed will block.&lt;br /&gt;
//&lt;br /&gt;
dilbegin fnpri(FN_PRI_RESCUE-1) aware unique cuffed(depname : string);&lt;br /&gt;
var&lt;br /&gt;
   cuffs  : unitptr;&lt;br /&gt;
   deputy : unitptr;&lt;br /&gt;
   i      : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   cuffs := equipment(self, WEAR_WRIST_R);&lt;br /&gt;
   secure(cuffs, broken);&lt;br /&gt;
&lt;br /&gt;
   deputy := self.master;&lt;br /&gt;
   secure(deputy, broken);&lt;br /&gt;
&lt;br /&gt;
   if ((deputy == null) or (cuffs == null))&lt;br /&gt;
   {&lt;br /&gt;
      log(&amp;quot;Cuffed lost either deputy or cuffs&amp;quot;);&lt;br /&gt;
      goto broken;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   heartbeat := PULSE_SEC * 1;&lt;br /&gt;
&lt;br /&gt;
   :loop:&lt;br /&gt;
   if (cuffs.equip != WEAR_WRIST_R)&lt;br /&gt;
     goto broken;&lt;br /&gt;
   priority; // Block all DILs running with a worse priority on this unit&lt;br /&gt;
   wait(SFB_TICK|SFB_CMD, activator == self);&lt;br /&gt;
   goto loop;&lt;br /&gt;
&lt;br /&gt;
   :broken:&lt;br /&gt;
   i := dildestroy(&amp;quot;cuffed2@midgaard&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- **Guard routine utilizing vme/zone/quest.zon DIL functions**&lt;br /&gt;
```&lt;br /&gt;
dilbegin guardroutine(guardloc: string, dayguard: integer);&lt;br /&gt;
external DailyRoutine@quests(sl : stringlist, sarg2 : string);&lt;br /&gt;
var sch: intlist;&lt;br /&gt;
code {&lt;br /&gt;
  if (dayguard) sch := {5, 18};  // Day schedule&lt;br /&gt;
  while (TRUE) {&lt;br /&gt;
    pause;&lt;br /&gt;
    if (mudhour == sch.[0]) {  // Wake/move at hour&lt;br /&gt;
      DailyRoutine@quests({&amp;quot;wake&amp;quot;, &amp;quot;walkto::$2t&amp;quot;, ...}, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    if (mudhour == sch.[1]) {  // Evening routine&lt;br /&gt;
      DailyRoutine@quests({&amp;quot;walkto::grunting_inn@midgaard&amp;quot;, &amp;quot;buy beer&amp;quot;, &amp;quot;sleep&amp;quot;}, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
- **Corpse scavenger** &lt;br /&gt;
```&lt;br /&gt;
dilbegin janitors(rate: integer);&lt;br /&gt;
var trash: unitptr;&lt;br /&gt;
code {&lt;br /&gt;
  foreach (UNIT_ST_OBJ, trash) {  // Scan surroundings for objects&lt;br /&gt;
    if (trash.objecttype == ITEM_CONTAINER &amp;amp;&amp;amp; isaff(trash, ID_CORPSE)) {&lt;br /&gt;
      // No need to secure item, foreach does it automatically&lt;br /&gt;
      exec(&amp;quot;get all from corpse&amp;quot;, self);&lt;br /&gt;
      // Scavenger would quickly be unable to carry more&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
```&lt;br /&gt;
# ZONE example with DIL examples&lt;br /&gt;
```&lt;br /&gt;
/*&lt;br /&gt;
filename    minimal-zone&lt;br /&gt;
password    testpass&lt;br /&gt;
changedby   AI Assistant&lt;br /&gt;
EmailAdd&lt;br /&gt;
request     compile&lt;br /&gt;
version     1&lt;br /&gt;
END HEADER*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;macros.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%zone&lt;br /&gt;
title &amp;quot;Minimal Test Zone@Mainland&amp;quot;&lt;br /&gt;
lifespan 10&lt;br /&gt;
reset RESET_ANYHOW&lt;br /&gt;
creators {&amp;quot;ai_assistant&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
notes&lt;br /&gt;
&amp;quot;A minimal zone demonstrating all major Haon-Dor zone fields and expressions.&lt;br /&gt;
Contains two comprehensive DIL examples:&lt;br /&gt;
1. comprehensive_demo() - Advanced DIL patterns for LLM learning&lt;br /&gt;
2. simple_demo() - Basic DIL patterns for beginners&lt;br /&gt;
Both examples demonstrate key concepts: variables, control flow, string/integer&lt;br /&gt;
operations, unit manipulation, combat, time functions, and more.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
help&lt;br /&gt;
&amp;quot;This is a minimal test zone created to demonstrate all of the key zone fields&lt;br /&gt;
and expressions used in Haon-Dor. Contains comprehensive DIL examples perfect&lt;br /&gt;
for learning DIL programming patterns. Zone by AI Assistant.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
%dil&lt;br /&gt;
/* ========================================================================&lt;br /&gt;
   COMPREHENSIVE DIL EXAMPLE - Perfect for LLM Learning&lt;br /&gt;
   This example demonstrates the most important DIL concepts and patterns&lt;br /&gt;
   ======================================================================== */&lt;br /&gt;
&lt;br /&gt;
dilbegin demo();&lt;br /&gt;
var&lt;br /&gt;
   target_player : unitptr;     // Unit pointer for finding players&lt;br /&gt;
   random_num : integer;        // For random number generation&lt;br /&gt;
   message_text : string;       // For string manipulation&lt;br /&gt;
   item_found : unitptr;        // For object manipulation&lt;br /&gt;
   oppo : unitptr;              // For combat operations&lt;br /&gt;
   plyr : unitptr;&lt;br /&gt;
   health_pct : integer;        // For calculations&lt;br /&gt;
   current_hour : integer;      // For time functions&lt;br /&gt;
   intr_hdl : integer;&lt;br /&gt;
   sl : stringlist;&lt;br /&gt;
   i : integer;&lt;br /&gt;
&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   // Set heartbeat to check every 5 seconds&lt;br /&gt;
   heartbeat := PULSE_SEC * 5;&lt;br /&gt;
   &lt;br /&gt;
   // Skip execution if NPC is asleep or fighting&lt;br /&gt;
   on_activation((self.position &amp;lt;= POSITION_SLEEPING), skip);&lt;br /&gt;
   interrupt(SFB_COM, activator == self, imfighting);&lt;br /&gt;
&lt;br /&gt;
 :main_loop:&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 1. COMMAND WAITING - Basic interaction pattern&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   wait(SFB_CMD, command(&amp;quot;say&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
   if (not (&amp;quot;hello&amp;quot; in argument) and not (&amp;quot;greet&amp;quot; in argument))&lt;br /&gt;
     goto main_loop;&lt;br /&gt;
   &lt;br /&gt;
   if (activator.type == UNIT_ST_PC)&lt;br /&gt;
   {&lt;br /&gt;
      plyr := activator;&lt;br /&gt;
      secure(plyr, main_loop);&lt;br /&gt;
&lt;br /&gt;
      // String concatenation with itoa() for numbers&lt;br /&gt;
      message_text := &amp;quot;Greetings, &amp;quot; + plyr.name + &amp;quot;! Your level is &amp;quot; + itoa(plyr.level) + &amp;quot;.&amp;quot;;&lt;br /&gt;
      exec(&amp;quot;say &amp;quot; + message_text, self);&lt;br /&gt;
      pause; // After this pause plyr is null&lt;br /&gt;
      &lt;br /&gt;
      // Random number generation and conditional logic&lt;br /&gt;
      random_num := rnd(1, 100);&lt;br /&gt;
      if (random_num &amp;gt; 70)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;emote smiles warmly.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
      else if (random_num &amp;gt; 30)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;emote nods politely.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;emote watches you with interest.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 2. TIME FUNCTIONS - Demonstrate game time awareness&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   current_hour := mudhour;&lt;br /&gt;
   sl := {&amp;quot;say Good morning to you!&amp;quot;, &amp;quot;say Good afternoon!&amp;quot;, &amp;quot;say What a lovely time to be alive!&amp;quot;};&lt;br /&gt;
   if (current_hour &amp;gt;= 6 and current_hour &amp;lt; 12) &lt;br /&gt;
      i := 0;&lt;br /&gt;
   else if (current_hour &amp;gt;= 12 and current_hour &amp;lt; 18)&lt;br /&gt;
      i := 1;&lt;br /&gt;
   else&lt;br /&gt;
      i := 2;&lt;br /&gt;
&lt;br /&gt;
   exec(sl.[i], self);&lt;br /&gt;
   pause;&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 3. UNIT SEARCHING - Find and interact with nearby units&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   target_player := findrndunit(self, FIND_UNIT_SURRO, UNIT_ST_PC);&lt;br /&gt;
   if (target_player != null)&lt;br /&gt;
   {&lt;br /&gt;
      // Health percentage calculation&lt;br /&gt;
      health_pct := (target_player.hp * 100) / target_player.max_hp;&lt;br /&gt;
      &lt;br /&gt;
      if (health_pct &amp;lt; 50)&lt;br /&gt;
      {&lt;br /&gt;
         act(&amp;quot;$1n says 'You look wounded! Let me help you.'&amp;quot;,&lt;br /&gt;
             A_SOMEONE, self, null, null, TO_ROOM);&lt;br /&gt;
         pause;&lt;br /&gt;
         &lt;br /&gt;
         // Healing demonstration&lt;br /&gt;
         target_player.hp := target_player.hp + 10;&lt;br /&gt;
         act(&amp;quot;$1n touches $3n, who feels slightly better.&amp;quot;,&lt;br /&gt;
             A_SOMEONE, self, null, target_player, TO_NOTVICT);&lt;br /&gt;
         act(&amp;quot;$1n touches you, and you feel slightly better.&amp;quot;,&lt;br /&gt;
             A_SOMEONE, self, null, target_player, TO_VICT);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 4. OBJECT MANIPULATION - Search for and handle items&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   foreach (UNIT_ST_OBJ, item_found)&lt;br /&gt;
   {&lt;br /&gt;
      if (item_found.outside == self)  // Item is on the NPC&lt;br /&gt;
      {&lt;br /&gt;
         if (item_found.objecttype == ITEM_WEAPON)&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say I am armed with &amp;quot; + item_found.title, self);&lt;br /&gt;
            break;  // Exit foreach loop after finding first weapon&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
      else if (item_found.outside == self.outside)  // Item is in the same room&lt;br /&gt;
      {&lt;br /&gt;
         if (item_found.objecttype == ITEM_CONTAINER)&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say I see a container here: &amp;quot; + item_found.title, self);&lt;br /&gt;
            break;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   pause;&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 5. COMBAT OPERATIONS - Basic combat AI&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   if (self.position == POSITION_FIGHTING)&lt;br /&gt;
   {&lt;br /&gt;
      oppo := self.fighting;&lt;br /&gt;
      if (oppo != null)&lt;br /&gt;
      {&lt;br /&gt;
         // Combat taunts based on oppo type&lt;br /&gt;
         if (oppo.type == UNIT_ST_PC)&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say You should not have challenged me!&amp;quot;, self);&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
            exec(&amp;quot;say Die, foul creature!&amp;quot;, self);&lt;br /&gt;
         }&lt;br /&gt;
         pause;&lt;br /&gt;
         &lt;br /&gt;
         // Wait for combat to end&lt;br /&gt;
         while (self.position == POSITION_FIGHTING)&lt;br /&gt;
            pause;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 6. MOVEMENT AND EXPLORATION - Room navigation&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   random_num := rnd(1, 10);&lt;br /&gt;
   if (random_num &amp;lt;= 3)  // 30% chance to move&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say I think I'll take a little walk.&amp;quot;, self);&lt;br /&gt;
      pause;&lt;br /&gt;
      &lt;br /&gt;
      // Try random directions (simplified example)&lt;br /&gt;
      random_num := rnd(1, 4);&lt;br /&gt;
      if (random_num == 1)&lt;br /&gt;
         exec(&amp;quot;north&amp;quot;, self);&lt;br /&gt;
      else if (random_num == 2)&lt;br /&gt;
         exec(&amp;quot;south&amp;quot;, self);&lt;br /&gt;
      else if (random_num == 3)&lt;br /&gt;
         exec(&amp;quot;east&amp;quot;, self);&lt;br /&gt;
      else&lt;br /&gt;
         exec(&amp;quot;west&amp;quot;, self);&lt;br /&gt;
      &lt;br /&gt;
      pause;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 7. ALIGNMENT AND ROLEPLAYING - React to player alignment&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   if (plyr.type == UNIT_ST_PC)&lt;br /&gt;
   {&lt;br /&gt;
      if (plyr.alignment &amp;lt; -300)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;say Your evil nature disturbs me.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
         exec(&amp;quot;emote watches you warily.&amp;quot;, self);&lt;br /&gt;
      }&lt;br /&gt;
      else if (plyr.alignment &amp;gt; 300)&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;say It is good to see a noble soul like yourself!&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
         exec(&amp;quot;emote smiles warmly.&amp;quot;, self);&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         exec(&amp;quot;say You seem to walk the middle path.&amp;quot;, self);&lt;br /&gt;
         pause;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // 8. MEMORY AND STATE - Simple quest/interaction tracking&lt;br /&gt;
   // ====================================================================&lt;br /&gt;
   // Check if player has a specific quest flag (simplified example)&lt;br /&gt;
   if (plyr.type == UNIT_ST_PC)&lt;br /&gt;
   {&lt;br /&gt;
      // This would normally check quest flags, simplified for demo&lt;br /&gt;
      exec(&amp;quot;say I remember meeting you before.&amp;quot;, self);&lt;br /&gt;
      pause;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   unsecure(plyr);&lt;br /&gt;
   // Loop back to main loop&lt;br /&gt;
   goto main_loop;&lt;br /&gt;
&lt;br /&gt;
:imfighting:&lt;br /&gt;
   exec(&amp;quot;say Darn it! I hate being in combat all the time&amp;quot;, self);&lt;br /&gt;
   // We could clear the interrupt here with&lt;br /&gt;
   // clear(intr_hdl);&lt;br /&gt;
   // But let's keep it coming.&lt;br /&gt;
   goto main_loop;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
/* ========================================================================&lt;br /&gt;
   SIMPLE DIL EXAMPLE - Basic patterns for beginners&lt;br /&gt;
   This demonstrates fundamental DIL concepts in a simple, clear way&lt;br /&gt;
   ======================================================================== */&lt;br /&gt;
&lt;br /&gt;
dilbegin basic();&lt;br /&gt;
var&lt;br /&gt;
   player : unitptr;          // Unit pointer for players&lt;br /&gt;
   roll : integer;            // Random number storage&lt;br /&gt;
   greeting : string;         // String manipulation&lt;br /&gt;
&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   // Check every 10 seconds&lt;br /&gt;
   heartbeat := PULSE_SEC * 10;&lt;br /&gt;
   &lt;br /&gt;
   // Don't run if asleep or fighting&lt;br /&gt;
   on_activation((self.position &amp;lt;= POSITION_SLEEPING) or&lt;br /&gt;
                 (self.position == POSITION_FIGHTING), skip);&lt;br /&gt;
&lt;br /&gt;
   :start:&lt;br /&gt;
   &lt;br /&gt;
   // Wait for any command from players or npcs&lt;br /&gt;
   wait(SFB_CMD, TRUE);&lt;br /&gt;
   &lt;br /&gt;
   // Only respond to players, not other NPCs&lt;br /&gt;
   if (activator.type != UNIT_ST_PC)&lt;br /&gt;
      goto start;&lt;br /&gt;
   &lt;br /&gt;
   player := activator;&lt;br /&gt;
&lt;br /&gt;
   // If the char leaves, reset and go back to start&lt;br /&gt;
   // right after the exec, player can be reset&lt;br /&gt;
   // unless we add this secure&lt;br /&gt;
   secure(player, start);&lt;br /&gt;
&lt;br /&gt;
   // Basic greeting with string concatenation&lt;br /&gt;
   greeting := &amp;quot;Hello, &amp;quot; + player.name + &amp;quot;!&amp;quot;;&lt;br /&gt;
   exec(&amp;quot;say &amp;quot; + greeting, self);&lt;br /&gt;
   pause;&lt;br /&gt;
&lt;br /&gt;
   // We cannot use activator down here because it'll be null&lt;br /&gt;
   &lt;br /&gt;
   // Random response pattern&lt;br /&gt;
   roll := rnd(1, 3);&lt;br /&gt;
   if (roll == 1)&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say It's a fine day for adventure!&amp;quot;, self);&lt;br /&gt;
   }&lt;br /&gt;
   else if (roll == 2)&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;hug &amp;quot; + player.name, self);&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say May fortune favor you!&amp;quot;, self);&lt;br /&gt;
   }&lt;br /&gt;
   pause;&lt;br /&gt;
   &lt;br /&gt;
   // Simple health check&lt;br /&gt;
   if (player.hp &amp;lt; player.max_hp / 2)&lt;br /&gt;
   {&lt;br /&gt;
      exec(&amp;quot;say You look wounded - be careful!&amp;quot;, self);&lt;br /&gt;
      pause;&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   unsecure(player);&lt;br /&gt;
&lt;br /&gt;
   // Loop back&lt;br /&gt;
   goto start;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
%rooms&lt;br /&gt;
&lt;br /&gt;
/* Minimal room demonstrating all key room fields */&lt;br /&gt;
minimal_room&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;minimal room&amp;quot;, &amp;quot;room&amp;quot;}&lt;br /&gt;
title &amp;quot;A Minimal Room&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a minimal room demonstrating all the key room fields and&lt;br /&gt;
expressions used in Haon-Dor. The room is simple but contains examples of&lt;br /&gt;
all major room properties.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;wall&amp;quot;, &amp;quot;walls&amp;quot;}&lt;br /&gt;
&amp;quot;The walls are made of simple stone blocks.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;floor&amp;quot;, &amp;quot;ground&amp;quot;}&lt;br /&gt;
&amp;quot;The floor is made of rough wooden planks.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;ceiling&amp;quot;}&lt;br /&gt;
&amp;quot;The ceiling is low and made of dark wooden beams.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
movement SECT_INSIDE&lt;br /&gt;
gmap(100,100)&lt;br /&gt;
&lt;br /&gt;
flags {UNIT_FL_INDOORS, UNIT_FL_NO_WEATHER, UNIT_FL_NO_MOB}&lt;br /&gt;
OUT_DARK_NON_NOON&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Second room for exit demonstrations */&lt;br /&gt;
minimal_room2&lt;br /&gt;
&lt;br /&gt;
title &amp;quot;Another Minimal Room&amp;quot;&lt;br /&gt;
descr &amp;quot;This is the second minimal room, used to demonstrate various exit&lt;br /&gt;
types and room connections.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;ceiling&amp;quot;}&lt;br /&gt;
&amp;quot;The ceiling is low and made of dark wooden beams.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
movement SECT_INSIDE&lt;br /&gt;
gmap(100,101)&lt;br /&gt;
&lt;br /&gt;
flags {UNIT_FL_INDOORS, UNIT_FL_NO_WEATHER}&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Third room for special terrain */&lt;br /&gt;
minimal_room3&lt;br /&gt;
&lt;br /&gt;
title &amp;quot;Room with Special Terrain&amp;quot;&lt;br /&gt;
descr &amp;quot;This room demonstrates special terrain types and movement&lt;br /&gt;
sectors. The ground here is different from other rooms.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;terrain&amp;quot;, &amp;quot;ground&amp;quot;}&lt;br /&gt;
&amp;quot;The terrain here is rough and uneven, making movement difficult.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
movement SECT_FOREST&lt;br /&gt;
gmap(100,99)&lt;br /&gt;
&lt;br /&gt;
OUT_DARK_NON_NOON&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
%objects&lt;br /&gt;
&lt;br /&gt;
/* Minimal object demonstrating all key object fields */&lt;br /&gt;
minimal_key&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;key&amp;quot;, &amp;quot;minimal key&amp;quot;}&lt;br /&gt;
title &amp;quot;a small minimal key&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a small, simple key that seems to fit minimal locks.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;lock&amp;quot;, &amp;quot;mechanism&amp;quot;}&lt;br /&gt;
&amp;quot;The key has a simple mechanism with basic teeth.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This key can be identified to reveal its purpose.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cost 10 IRON_PIECE&lt;br /&gt;
rent 1 IRON_PIECE&lt;br /&gt;
&lt;br /&gt;
manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD}&lt;br /&gt;
type ITEM_KEY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
weight 1&lt;br /&gt;
bright 0&lt;br /&gt;
&lt;br /&gt;
key minimal_key&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Weapon example */&lt;br /&gt;
minimal_sword&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;sword&amp;quot;, &amp;quot;minimal sword&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal sword&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple, unadorned sword with minimal decoration.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;blade&amp;quot;, &amp;quot;hilt&amp;quot;}&lt;br /&gt;
&amp;quot;The blade is plain but sharp. The hilt is wrapped in basic leather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This sword can be identified to reveal its craftsmanship.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$improved identify&amp;quot;}&lt;br /&gt;
&amp;quot;This sword can be identified to reveal its craftsmanship.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
WEAPON_DEF(WPN_SCIMITAR, BONUS_AVERAGE, BONUS_AVERAGE)&lt;br /&gt;
&lt;br /&gt;
cost 50 IRON_PIECE&lt;br /&gt;
rent 5 IRON_PIECE&lt;br /&gt;
flags {UNIT_FL_MAGIC}&lt;br /&gt;
&lt;br /&gt;
weight 10&lt;br /&gt;
bright 0&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Container example */&lt;br /&gt;
minimal_chest&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;chest&amp;quot;, &amp;quot;minimal chest&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal chest&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple wooden chest with minimal decoration.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;lock&amp;quot;, &amp;quot;hinges&amp;quot;}&lt;br /&gt;
&amp;quot;The chest has a simple lock and basic metal hinges.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This chest can be identified to reveal its contents capacity.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cost 25 IRON_PIECE&lt;br /&gt;
rent 2 IRON_PIECE&lt;br /&gt;
&lt;br /&gt;
manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD}&lt;br /&gt;
type ITEM_CONTAINER&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
weight 15&lt;br /&gt;
bright 0&lt;br /&gt;
&lt;br /&gt;
capacity 50&lt;br /&gt;
key minimal_key&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
%mobiles&lt;br /&gt;
&lt;br /&gt;
/* Minimal NPC demonstrating all key NPC fields */&lt;br /&gt;
minimal_guard&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;guard&amp;quot;, &amp;quot;minimal guard&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal guard&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple guard with minimal equipment and basic appearance.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;armor&amp;quot;, &amp;quot;weapon&amp;quot;}&lt;br /&gt;
&amp;quot;The guard wears basic leather armor and carries a simple sword.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This guard can be identified to reveal his combat capabilities.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dilcopy demo@minimal_zone();&lt;br /&gt;
&lt;br /&gt;
M_AVG_HUMAN(5, SEX_MALE)&lt;br /&gt;
&lt;br /&gt;
alignment 100&lt;br /&gt;
exp 100&lt;br /&gt;
&lt;br /&gt;
position POSITION_STANDING&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
/* Second NPC for variety */&lt;br /&gt;
minimal_merch&lt;br /&gt;
&lt;br /&gt;
names {&amp;quot;merchant&amp;quot;, &amp;quot;minimal merchant&amp;quot;}&lt;br /&gt;
title &amp;quot;a minimal merchant&amp;quot;&lt;br /&gt;
descr &amp;quot;This is a simple merchant with basic goods and minimal haggling skills.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;goods&amp;quot;, &amp;quot;wares&amp;quot;}&lt;br /&gt;
&amp;quot;The merchant has a small selection of basic goods for sale.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extra {&amp;quot;$identify&amp;quot;}&lt;br /&gt;
&amp;quot;This merchant can be identified to reveal her shop inventory.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dilcopy basic@minimal_zone();&lt;br /&gt;
dilcopy qstSimpleQuest@quests(&amp;quot;Merchant Quest&amp;quot;,&lt;br /&gt;
    {&amp;quot;say I need a specific key - or ANY kind of carrot! Can you help?&amp;quot;,&lt;br /&gt;
     &amp;quot;say Please bring me the key quickly!&amp;quot;},&lt;br /&gt;
    {&amp;quot;say Thanks for the key!&amp;quot;},&lt;br /&gt;
    &amp;quot;Fetch a key for minimal merchant in minimal world.&amp;quot;,&lt;br /&gt;
    {&amp;quot;thank $1N&amp;quot;,&lt;br /&gt;
     &amp;quot;emote adores his new key.&amp;quot;},&lt;br /&gt;
    500, 1 * COPPER_MULT, {&amp;quot;&amp;quot;}, &amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// The empty stringlist {&amp;quot;&amp;quot;} could be a custom DIL function to validate each item,&lt;br /&gt;
// e.g. if a barrel is more than half full of water or if it's a real boat &amp;quot;boatcheck@quests&amp;quot;.&lt;br /&gt;
// By default it's just checking name matching&lt;br /&gt;
dilcopy qstItemsWanted@quests(QUEST_MY_FETCH, {&amp;quot;carrot&amp;quot;, &amp;quot;minimal_key@minimal_zone&amp;quot;}, {&amp;quot;&amp;quot;},&lt;br /&gt;
    {&amp;quot;say Perfect, that's just the key I needed!&amp;quot;},&lt;br /&gt;
    &amp;quot;say I need a specific key, not that garbage!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
M_AVG_HUMAN(3, SEX_FEMALE)&lt;br /&gt;
&lt;br /&gt;
alignment 0&lt;br /&gt;
exp 50&lt;br /&gt;
&lt;br /&gt;
position POSITION_STANDING&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
%reset&lt;br /&gt;
&lt;br /&gt;
/* Reset actions demonstrating all key reset expressions */&lt;br /&gt;
&lt;br /&gt;
/* Load NPCs */&lt;br /&gt;
load minimal_guard into minimal_room max 1&lt;br /&gt;
{&lt;br /&gt;
    equip minimal_sword position WEAR_WIELD max 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
load minimal_merch into minimal_room2 max 1&lt;br /&gt;
&lt;br /&gt;
/* Load objects */&lt;br /&gt;
load minimal_key into minimal_guard max 1&lt;br /&gt;
load minimal_chest into minimal_room max 1&lt;br /&gt;
load minimal_key into minimal_chest max 1&lt;br /&gt;
load minimal_sword into minimal_room max 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* Door states */&lt;br /&gt;
door minimal_room NORTH {EX_OPEN_CLOSE}&lt;br /&gt;
&lt;br /&gt;
/* Local objects (zone-wide) */&lt;br /&gt;
load minimal_key local 5&lt;br /&gt;
&lt;br /&gt;
/* Zone max objects */&lt;br /&gt;
load minimal_sword zonemax 10&lt;br /&gt;
&lt;br /&gt;
/* Zone reset time */&lt;br /&gt;
&lt;br /&gt;
%end&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1267</id>
		<title>Manual:DIL Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual&amp;diff=1267"/>
		<updated>2025-12-06T07:43:14Z</updated>

		<summary type="html">&lt;p&gt;Papi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
'''You can view a full listing of the DIL manual at [[Manual:DIL_Manual_(Full_Listing)]] or browse by topic using the links below.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;AGENT.md&amp;lt;/h3&amp;gt;&lt;br /&gt;
Get the latest [https://github.com/Seifert69/DikuMUD3/blob/master/vme/doc/dil/AGENT.md AGENT.md on Github] to make your LLM create better code.&lt;br /&gt;
This copy might be outdated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Index&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Making a Program|Making a Program]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Data Types|Data Types]]&lt;br /&gt;
  [[Manual:DIL_Manual/string|string]]&lt;br /&gt;
  [[Manual:DIL_Manual/stringlist|stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/integer|integer]]&lt;br /&gt;
  [[Manual:DIL_Manual/integerlist|integerlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdptr|cmdptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/zoneptr|zoneptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Messages|Messages]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_CMD|SFB_CMD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DONE|SFB_DONE]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_TICK|SFB_TICK]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_COM|SFB_COM]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_DEAD|SFB_DEAD]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_MSG|SFB_MSG]]&lt;br /&gt;
  [[Manual:DIL_Manual/SFB_PRE|SFB_PRE]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Variables|Built-In Variables]]&lt;br /&gt;
  [[Manual:DIL_Manual/cmdstr|cmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr|excmdstr]]&lt;br /&gt;
  [[Manual:DIL_Manual/excmdstr_case|excmdstr_case]]&lt;br /&gt;
  [[Manual:DIL_Manual/self|self]]&lt;br /&gt;
  [[Manual:DIL_Manual/activator|activator]]&lt;br /&gt;
  [[Manual:DIL_Manual/target|target]]&lt;br /&gt;
  [[Manual:DIL_Manual/medium|medium]]&lt;br /&gt;
  [[Manual:DIL_Manual/power|power]]&lt;br /&gt;
  [[Manual:DIL_Manual/argument|argument]]&lt;br /&gt;
  [[Manual:DIL_Manual/heartbeat|heartbeat]]&lt;br /&gt;
  [[Manual:DIL_Manual/null|null]]&lt;br /&gt;
  [[Manual:DIL_Manual/weather|weather]]&lt;br /&gt;
  [[Manual:DIL_Manual/realtime|realtime]]&lt;br /&gt;
  [[Manual:DIL_Manual/mud(day,month,..)|mud(day,month,..)]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/DIL Constructs|DIL Constructs]]&lt;br /&gt;
  [[Manual:DIL_Manual/if()|if()]]&lt;br /&gt;
  [[Manual:DIL_Manual/goto|goto]]&lt;br /&gt;
  [[Manual:DIL_Manual/while()|while()]]&lt;br /&gt;
  [[Manual:DIL_Manual/break|break]]&lt;br /&gt;
  [[Manual:DIL_Manual/continue|continue]]&lt;br /&gt;
  [[Manual:DIL_Manual/on ... goto ...|on ... goto ...]]&lt;br /&gt;
  [[Manual:DIL_Manual/foreach()|foreach()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Assignment|Assignment]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Expressions|Expressions]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Operators|Operators]]&lt;br /&gt;
  [[Manual:DIL_Manual/in|in]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in string|string in string]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in stringlist|string in stringlist]]&lt;br /&gt;
  [[Manual:DIL_Manual/string in extraptr|string in extraptr]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Functions|Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/quit|quit]]&lt;br /&gt;
  [[Manual:DIL_Manual/return|return]]&lt;br /&gt;
  [[Manual:DIL_Manual/return()|return()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Fields|Fields]]&lt;br /&gt;
  [[Manual:DIL_Manual/extraptr|extraptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitptr|unitptr]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_OBJ|UNIT_ST_OBJ]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_ROOM|UNIT_ST_ROOM]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC and UNIT_ST_NPC|UNIT_ST_PC and UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_NPC|UNIT_ST_NPC]]&lt;br /&gt;
  [[Manual:DIL_Manual/UNIT_ST_PC|UNIT_ST_PC]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Built-In Functions|Built-In Functions]]&lt;br /&gt;
  [[Manual:DIL_Manual/asctime()|asctime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strcmp()|strcmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strncmp()|strncmp()]]&lt;br /&gt;
  [[Manual:DIL_Manual/textformat()|textformat()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellindex()|spellindex()]]&lt;br /&gt;
  [[Manual:DIL_Manual/spellinfo()|spellinfo()]]&lt;br /&gt;
  [[Manual:DIL_Manual/beginedit()|beginedit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cancarry()|cancarry()]]&lt;br /&gt;
  [[Manual:DIL_Manual/fits()|fits()]]&lt;br /&gt;
  [[Manual:DIL_Manual/replace()|replace()]]&lt;br /&gt;
  [[Manual:DIL_Manual/restore()|restore()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleeattack()|meleeattack()]]&lt;br /&gt;
  [[Manual:DIL_Manual/meleedamage()|meleedamage()]]&lt;br /&gt;
  [[Manual:DIL_Manual/mid()|mid()]]&lt;br /&gt;
  [[Manual:DIL_Manual/moneystring()|moneystring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/equipment()|equipment()]]&lt;br /&gt;
  [[Manual:DIL_Manual/tolower()|tolower()]]&lt;br /&gt;
  [[Manual:DIL_Manual/toupper()|toupper()]]&lt;br /&gt;
  [[Manual:DIL_Manual/visible()|visible()]]&lt;br /&gt;
  [[Manual:DIL_Manual/opponent()|opponent()]]&lt;br /&gt;
  [[Manual:DIL_Manual/purse()|purse()]]&lt;br /&gt;
  [[Manual:DIL_Manual/atoi()|atoi()]]&lt;br /&gt;
  [[Manual:DIL_Manual/check_password()|check_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/command()|command()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delstr()|delstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delunit()|delunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dildestroy()|dildestroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilfind()|dilfind()]]&lt;br /&gt;
  [[Manual:DIL_Manual/itoa()|itoa()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isaff()|isaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/islight()|islight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isplayer()|isplayer()]]&lt;br /&gt;
  [[Manual:DIL_Manual/isset()|isset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/paycheck()|paycheck()]]&lt;br /&gt;
  [[Manual:DIL_Manual/filesize()|filesize()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findunit()|findunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findrndunit()|findrndunit()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findroom()|findroom()]]&lt;br /&gt;
  [[Manual:DIL_Manual/findsymbolic()|findsymbolic()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getword()|getword()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getwords()|getwords()]]&lt;br /&gt;
  [[Manual:DIL_Manual/ghead()|ghead()]]&lt;br /&gt;
  [[Manual:DIL_Manual/split()|split()]]&lt;br /&gt;
  [[Manual:DIL_Manual/left()|left()]]&lt;br /&gt;
  [[Manual:DIL_Manual/length()|length()]]&lt;br /&gt;
  [[Manual:DIL_Manual/load()|load()]]&lt;br /&gt;
  [[Manual:DIL_Manual/loadstr()|loadstr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/openroll()|openroll()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pathto()|pathto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/pagestring()|pagestring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/right()|right()]]&lt;br /&gt;
  [[Manual:DIL_Manual/rnd()|rnd()]]&lt;br /&gt;
  [[Manual:DIL_Manual/Built-In Procedures|Built-In Procedures]]&lt;br /&gt;
  [[Manual:DIL_Manual/follow()|follow()]]&lt;br /&gt;
  [[Manual:DIL_Manual/flog()|flog()]]&lt;br /&gt;
  [[Manual:DIL_Manual/logcrime()|logcrime()]]&lt;br /&gt;
  [[Manual:DIL_Manual/acc_modify()|acc_modify()]]&lt;br /&gt;
  [[Manual:DIL_Manual/strdir()|strdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_password()|set_password()]]&lt;br /&gt;
  [[Manual:DIL_Manual/store()|store()]]&lt;br /&gt;
  [[Manual:DIL_Manual/position_update()|position_update()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_done()|send_done()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send_pre()|send_pre()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set()|set()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unset()|unset()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addcolor()|addcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delcolor()|delcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getcolor()|getcolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/changecolor()|changecolor()]]&lt;br /&gt;
  [[Manual:DIL_Manual/gamestate()|gamestate()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addextra()|addextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addstring()|addstring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subextra()|subextra()]]&lt;br /&gt;
  [[Manual:DIL_Manual/substring()|substring()]]&lt;br /&gt;
  [[Manual:DIL_Manual/stop_fighting()|stop_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/subaff()|subaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/addaff()|addaff()]]&lt;br /&gt;
  [[Manual:DIL_Manual/destroy()|destroy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/walkto()|walkto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/link()|link()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_name()|weapon_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/weapon_info()|weapon_info()]]&lt;br /&gt;
  [[Manual:DIL_Manual/skill_name()|skill_name()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reboot|reboot]]&lt;br /&gt;
  [[Manual:DIL_Manual/killedit|killedit]]&lt;br /&gt;
  [[Manual:DIL_Manual/experience()|experience()]]&lt;br /&gt;
  [[Manual:DIL_Manual/act()|act()]]&lt;br /&gt;
  [[Manual:DIL_Manual/exec()|exec()]]&lt;br /&gt;
  [[Manual:DIL_Manual/wait()|wait()]]&lt;br /&gt;
  [[Manual:DIL_Manual/savestr()|savestr()]]&lt;br /&gt;
  [[Manual:DIL_Manual/remove()|remove()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_level()|reset_level()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_vlevel()|reset_vlevel()]]&lt;br /&gt;
  [[Manual:DIL_Manual/reset_race()|reset_race()]]&lt;br /&gt;
  [[Manual:DIL_Manual/secure()|secure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unitdir()|unitdir()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unsecure()|unsecure()]]&lt;br /&gt;
  [[Manual:DIL_Manual/block|block]]&lt;br /&gt;
  [[Manual:DIL_Manual/priority|priority]]&lt;br /&gt;
  [[Manual:DIL_Manual/nopriority|nopriority]]&lt;br /&gt;
  [[Manual:DIL_Manual/addequip()|addequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/unequip()|unequip()]]&lt;br /&gt;
  [[Manual:DIL_Manual/delete_player()|delete_player()]]&lt;br /&gt;
  [[Manual:DIL_Manual/dilcopy()|dilcopy()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtext()|sendtext()]]&lt;br /&gt;
  [[Manual:DIL_Manual/change_speed()|change_speed()]]&lt;br /&gt;
  [[Manual:DIL_Manual/transfermoney()|transfermoney()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_fighting()|set_fighting()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight_base|set_weight_base()]]&lt;br /&gt;
  [[Manual:DIL_Manual/set_weight|set_weight()]]&lt;br /&gt;
  [[Manual:DIL_Manual/setbright()|setbright()]]&lt;br /&gt;
  [[Manual:DIL_Manual/log()|log()]]&lt;br /&gt;
  [[Manual:DIL_Manual/send()|send()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendto()|sendto()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoall()|sendtoall()]]&lt;br /&gt;
  [[Manual:DIL_Manual/sendtoalldil()|sendtoalldil()]]&lt;br /&gt;
  [[Manual:DIL_Manual/cast_spell()|cast_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/attack_spell()|attack_spell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/insert()|insert()]]&lt;br /&gt;
  [[Manual:DIL_Manual/interrupt()|interrupt()]]&lt;br /&gt;
  [[Manual:DIL_Manual/clear()|clear()]]&lt;br /&gt;
  [[Manual:DIL_Manual/on_activation()|on_activation()]]&lt;br /&gt;
  [[Manual:DIL_Manual/shell()|shell()]]&lt;br /&gt;
  [[Manual:DIL_Manual/getaffects()|getaffects()]]&lt;br /&gt;
&lt;br /&gt;
[[Manual:DIL_Manual/Ending Notes|Ending Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Manual Title Pages]]&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unitptr&amp;diff=1083</id>
		<title>Manual:DIL Manual/unitptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unitptr&amp;diff=1083"/>
		<updated>2025-12-04T11:09:48Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;unit&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''The unitptr has the following fields:'''&lt;br /&gt;
&lt;br /&gt;
    unitptr:&lt;br /&gt;
       'names'        :stringlist (RW)&lt;br /&gt;
          A list of names that matches the unit.&lt;br /&gt;
       'name'         :string (RW)&lt;br /&gt;
          The first name in the namelist in 'names'&lt;br /&gt;
       'outside_descr' :string (RW)&lt;br /&gt;
          The description of the unit from the 'outside'. f.inst.&lt;br /&gt;
          the description of a boat, seen from the outside.&lt;br /&gt;
       'inside_descr' :string (RW)&lt;br /&gt;
          The description of the unit from the 'inside'. f.inst.&lt;br /&gt;
          the description of a boat, seen from the inside.&lt;br /&gt;
       'next'         :unitptr (RO)&lt;br /&gt;
          The next unit in the local list of units. For instance, the&lt;br /&gt;
          units in the inventory of a PC, is linked with this field.&lt;br /&gt;
       'title'        :string (RW)&lt;br /&gt;
          The title of the unit.&lt;br /&gt;
       'extra'        :extraptr (RW)&lt;br /&gt;
          Extra descriptions of the unit (identify, look at, read etc.).&lt;br /&gt;
       'outside'      :unitptr (RO)&lt;br /&gt;
          The outside of the unit hierarchy (carried by, contained by).&lt;br /&gt;
          For instance, the contents of a bag have their 'outside'&lt;br /&gt;
          field pointing to the bag.&lt;br /&gt;
       'inside'       :unitptr (RO)&lt;br /&gt;
          The inside of the unit hierarchy (carry, contains).&lt;br /&gt;
          For instance the first unit in a PC's inventory is referenced&lt;br /&gt;
          by the 'inside' field.&lt;br /&gt;
       'key'       :string (RO)&lt;br /&gt;
          The key that will open this unitptr&lt;br /&gt;
          For instance &amp;quot;big_key@blackzon&amp;quot;&lt;br /&gt;
 		          by the 'inside' field.&lt;br /&gt;
       'gnext'        :unitptr (RO)&lt;br /&gt;
          Next unit in the global list of units.&lt;br /&gt;
       'gprevious'    :unitptr (RO)&lt;br /&gt;
          Previous unit in the global list of units.&lt;br /&gt;
       'hasfunc'      :integer (RO)&lt;br /&gt;
          Returns TRUE if unit has special functions attached to it.&lt;br /&gt;
       'max_hp'       :integer (RO/RW)&lt;br /&gt;
          The maximum hitpoints of unit, RO for players, RW for mobiles.&lt;br /&gt;
       'max_mana'       :integer (RO)&lt;br /&gt;
          The maximum mana of the character (player or mobile).&lt;br /&gt;
       'max_endurance'  :integer (RO)&lt;br /&gt;
          The maximum endurance of the character (player or mobile).&lt;br /&gt;
       'lifespan'       :integer (RW)&lt;br /&gt;
          The lifespan of a character, write permission only on root access.&lt;br /&gt;
       'hp'           :integer (RW)&lt;br /&gt;
          The current hitpoints of unit. For objects, this can render&lt;br /&gt;
          it 'broken' by being set low. If an unit has -1 hitpoints&lt;br /&gt;
          its considered unbreakable.&lt;br /&gt;
       'manipulate'   :integer (RW)&lt;br /&gt;
          Bits that specify how unit can be handled, see MANIPULATE_*&lt;br /&gt;
          flags in values.h and/or vme.h&lt;br /&gt;
       'flags'        :integer (RW)&lt;br /&gt;
          Bits that specify different properties of a unit, see&lt;br /&gt;
          UNIT_FL_* in values.h and/or vme.h&lt;br /&gt;
       'baseweight'   :integer (RO)&lt;br /&gt;
          The empty weight of the unit. This can be set with the&lt;br /&gt;
          procedure 'setweight()'&lt;br /&gt;
       'weight'       :integer (RO)&lt;br /&gt;
          The current weight of the unit (and its contents).&lt;br /&gt;
       'capacity'     :integer (RW)&lt;br /&gt;
          The amount of weight the unit can contain.&lt;br /&gt;
       'height'       :integer (RW)&lt;br /&gt;
          The height of a PC/NPC, the length of a rope, the size of weapons,&lt;br /&gt;
          armours, and shields.&lt;br /&gt;
       'alignment'    :integer (RW)&lt;br /&gt;
          The alignment of the unit. [1000..-1000],&lt;br /&gt;
          1000 is good, 0 is neutral, -1000 is evil.&lt;br /&gt;
       'openflags'    :integer (RW)&lt;br /&gt;
          Bits thats specify how a unit may be opened, locked, etc,&lt;br /&gt;
          see EX_* in values.&lt;br /&gt;
       'light'        :integer (RO)&lt;br /&gt;
          How much light is inside the unit.&lt;br /&gt;
       'bright'       :integer (RO)&lt;br /&gt;
          How much the unit lights up. This can be set with the&lt;br /&gt;
          procedure 'setbright()'&lt;br /&gt;
       'illum'        :integer (RO)&lt;br /&gt;
          How much light units inside a transparent unit create&lt;br /&gt;
       'minv'         :integer (RW)&lt;br /&gt;
          The 'wizard invisibility' level.&lt;br /&gt;
       'spells'[]     :integer (RO)&lt;br /&gt;
          The defence/skill of the different spell spheres/spells&lt;br /&gt;
          The index should be one of the SPL_* in values.h and/or vme.h&lt;br /&gt;
       'zoneidx'      :string (RO)&lt;br /&gt;
          The unique database name (in the zone) for this unit.&lt;br /&gt;
       'nameidx'      :string (RO)&lt;br /&gt;
          The unique database zone name for this unit.&lt;br /&gt;
       'idx'      :integer (RO)&lt;br /&gt;
          The unique database index (in the zone) for this unit.&lt;br /&gt;
          This provides a smart alternative to check for zoneidx&lt;br /&gt;
          and nameidx. Thus if (u1.idx == u2.idx) then&lt;br /&gt;
          (u1.nameidx == u2.nameidx) and (u1.zoneidx == u2.zoneidx).&lt;br /&gt;
          Be warned, this value change between each reboot, so do not&lt;br /&gt;
          count on it for purposes of saving.&lt;br /&gt;
       'zone'         :string (RO)&lt;br /&gt;
          The name of the zone the unit is in.&lt;br /&gt;
       'type'         :integer (RO)&lt;br /&gt;
          The type of the unit, see UNIT_ST_* in values.h and/or vme.h&lt;br /&gt;
       'loadcount'    :integer (RO)&lt;br /&gt;
          Returns the number of units loaded in the game&lt;br /&gt;
          of this definition (zoneidx,nameidx / idx)&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extraptr&amp;diff=1082</id>
		<title>Manual:DIL Manual/extraptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extraptr&amp;diff=1082"/>
		<updated>2025-12-04T11:09:33Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;extra&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''The extraptr has the following fields:'''&lt;br /&gt;
&lt;br /&gt;
    extraptr:&lt;br /&gt;
       'names'        :stringlist (RW)&lt;br /&gt;
          names is a list of strings of names, that the extra description matches on.&lt;br /&gt;
       'descr'        :string (RW)&lt;br /&gt;
          descr is the contents of the extra description.&lt;br /&gt;
       'next'         :extraptr (RO)&lt;br /&gt;
          next is the next extra description in a list.&lt;br /&gt;
       'vals'        :intlist (RW)&lt;br /&gt;
          vals is a list of integer values attached to this extra.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 The unitptr is the key structure in the MUD, containing any kind of the&lt;br /&gt;
 following subtypes:&lt;br /&gt;
&lt;br /&gt;
    object      : a normal object, a sword, a vail, etc.&lt;br /&gt;
    room        : a room, location or the like.&lt;br /&gt;
    pc          : a playing character.&lt;br /&gt;
    npc         : a non playing character (mobile, monster, etc)&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unitptr&amp;diff=1081</id>
		<title>Manual:DIL Manual/unitptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unitptr&amp;diff=1081"/>
		<updated>2025-12-04T11:08:40Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;uptr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Unitptr:'''&lt;br /&gt;
&lt;br /&gt;
   Unit pointers are used to keep track of units: rooms, players, non-player or&lt;br /&gt;
 objects. Through a variable of this type you can access most of the information&lt;br /&gt;
 in a unit. Unitptr variables are 'volatile', and thus cleared whenever there is&lt;br /&gt;
 a possibility that they are rendered unusable.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Messages&amp;diff=1080</id>
		<title>Manual:DIL Manual/Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Messages&amp;diff=1080"/>
		<updated>2025-12-04T10:47:15Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;messies&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''Messages:'''&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   In DIL, a program attached to a unit gets activated when the program receives&lt;br /&gt;
 a message. In order to save CPU usage, there are a number of different message&lt;br /&gt;
 categories which can cause activation of a program.  The 'wait()' commands first&lt;br /&gt;
 parameter is an integer, telling what message categories the program should&lt;br /&gt;
 reactivate on.  The second parameter is an expression, which also must evaluate&lt;br /&gt;
 to TRUE. 'pause' is just special instances of the 'wait()' command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strong&amp;gt;Caveat Builder: &amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Whenever you construct the arguments for the wait command, bear in mind that&lt;br /&gt;
 ALL your tests will be executed EVERYTIME a message of the relevant kind comes&lt;br /&gt;
 through.  Thus you should keep the length of the activation expression to a&lt;br /&gt;
 reasonable minimum, and you should NEVER use the time-consuming findxxx-functions.&lt;br /&gt;
&lt;br /&gt;
 Valid example (That prohibits a player from removing an object):&lt;br /&gt;
&lt;br /&gt;
 :glue:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 	wait(SFB_CMD,command(CMD_REMOVE));&lt;br /&gt;
 	u := findunit(activator,argument,FIND_UNIT_IN_ME,null );&lt;br /&gt;
 	if (u != self)&lt;br /&gt;
 	 {&lt;br /&gt;
 		goto glue;&lt;br /&gt;
 	 }&lt;br /&gt;
 	act(&amp;quot;You can't remove $2n, it's sticky.&amp;quot;,&lt;br /&gt;
 	   A_SOMEONE,activator,self,null,TO_CHAR););&lt;br /&gt;
 	block;&lt;br /&gt;
 	goto glue;&lt;br /&gt;
&lt;br /&gt;
 '''See Also:'''&lt;br /&gt;
 [[#findunit.html|Dil and Findunit()]]&lt;br /&gt;
&lt;br /&gt;
 The message categories are as follows:&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/split()&amp;diff=1079</id>
		<title>Manual:DIL Manual/split()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/split()&amp;diff=1079"/>
		<updated>2025-12-04T10:47:00Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfsplit&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 stringlist split ( var s : string, var t : string)&lt;br /&gt;
        s : A string with zero or more words separated by var t.&lt;br /&gt;
    return: A stringlist where each string was a word in 's'&lt;br /&gt;
            separated by string 't'.&lt;br /&gt;
&lt;br /&gt;
 		   You can use '&amp;amp;amp;x' to split a string by line.  This is very usefull when reading in files with 'loadstr'.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/rnd()&amp;diff=1078</id>
		<title>Manual:DIL Manual/rnd()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/rnd()&amp;diff=1078"/>
		<updated>2025-12-04T10:46:45Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfrnd&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 integer rnd ( i1 : integer , i2 : integer )&lt;br /&gt;
    i1 : Start of range.&lt;br /&gt;
    i2 : End of range.&lt;br /&gt;
    return: A random integer in an interval from 'i1' to 'i2'.&lt;br /&gt;
    Example: i := rnd(1,10);&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Fields&amp;diff=1077</id>
		<title>Manual:DIL Manual/Fields</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Fields&amp;diff=1077"/>
		<updated>2025-12-04T10:46:41Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''Fields:'''&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 The 'extraptr' and 'unitptr' types contain information which is available to&lt;br /&gt;
 you by using fields. For example (self is a unitptr), self.inside is a&lt;br /&gt;
 unitptr to what is inside the 'self' unit. (Hence '.inside' is the field).&lt;br /&gt;
 And self.inside.outside is a unitptr to self (assuming that something is&lt;br /&gt;
 actually inside self, otherwise self.inside would evaluate to null).&lt;br /&gt;
 Some fields may not be changed by DIL programs directly but must be modified&lt;br /&gt;
 indirectly using certain procedure calls in DIL. Others may not be changed&lt;br /&gt;
 at all. All are readable for DIL programs.&lt;br /&gt;
&lt;br /&gt;
 The extraptr structure is used for several things. The primary is&lt;br /&gt;
 extra descriptions for units, and quest data. Keywords in the 'names'&lt;br /&gt;
 field and the actual description/data in the 'descr' field.&lt;br /&gt;
&lt;br /&gt;
 In the following (RW) means the value may be assigned new values by DIL,&lt;br /&gt;
 while (RO) means the the value only can be read. A (RO) value might be&lt;br /&gt;
 possible to change through built-in functions/procedures&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/integer&amp;diff=1076</id>
		<title>Manual:DIL Manual/integer</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/integer&amp;diff=1076"/>
		<updated>2025-12-04T10:46:33Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;int&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Integer:'''&lt;br /&gt;
&lt;br /&gt;
   Non-fraction numbers can be used throughout your DIL programs.  They are given&lt;br /&gt;
 normally, or in normal C style hexadecimal, preceded with '0x'. Integers are&lt;br /&gt;
 signed 32-bit integers.  Variables of type string are saved with DIL programs,&lt;br /&gt;
 if attached to a saved unit.&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   0x10&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   2&lt;br /&gt;
&lt;br /&gt;
   Integers are used within expressions as both number value and boolean(true/false)&lt;br /&gt;
 values. You may use comparison between integers through the comparison operators:&lt;br /&gt;
 '==' (equality),&lt;br /&gt;
 '&amp;lt;' (less than),&lt;br /&gt;
 '&amp;gt;' (greater than),&lt;br /&gt;
 '&amp;lt;=' (less or equal),&lt;br /&gt;
 '&amp;gt;=' (greater or equal)&lt;br /&gt;
 '!=' (not equal).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   if (42&amp;lt;12) ...&lt;br /&gt;
&lt;br /&gt;
   Returning the boolean value (true/false) depending on the comparison between&lt;br /&gt;
 integers. The result may be stored in an integer variable, and tested later, or&lt;br /&gt;
 used directly in an 'if' or 'while', etc.  You may also operate on boolean&lt;br /&gt;
 expression themselves, using LOGICAL operators 'and','not','or', which allows&lt;br /&gt;
 you to combine the expressions.&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   if ( not ( (self.hp&amp;lt;42) or (self.level&amp;gt;10) ) ) ..&lt;br /&gt;
&lt;br /&gt;
 Integer expressions may also use a number of other operators:&lt;br /&gt;
 '+' (addition)&lt;br /&gt;
 '-' (subtraction/negation),&lt;br /&gt;
 '*' (multiplication),&lt;br /&gt;
 '/' (division),&lt;br /&gt;
 '|' (bitwise or, for flags),&lt;br /&gt;
 '&amp;amp;' (bitwise and, for flags)&lt;br /&gt;
&lt;br /&gt;
 Precedence rules for using these operators are still somewhat messed up.  You'd&lt;br /&gt;
 better use parenthesis where ever possible.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/equipment()&amp;diff=1075</id>
		<title>Manual:DIL Manual/equipment()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/equipment()&amp;diff=1075"/>
		<updated>2025-12-04T10:46:16Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfeq&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 unitptr equipment ( u : unitptr , i : integer )&lt;br /&gt;
    u : The character to search.&lt;br /&gt;
    i : What equipment to find, any of the WEAR_XXX macros.&lt;br /&gt;
    result: Returns the unit on 'u' which is equipped on position 'i'.&lt;br /&gt;
            See WEAR_* in values.h and/or vme.h&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/follow()&amp;diff=1074</id>
		<title>Manual:DIL Manual/follow()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/follow()&amp;diff=1074"/>
		<updated>2025-12-04T10:46:14Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpfol&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 follow( f : unitptr, m : unitptr )&lt;br /&gt;
    f : The character to follow&lt;br /&gt;
    m : The character to be followed&lt;br /&gt;
&lt;br /&gt;
    Unconditionally makes 'f' follow 'm', even if 'f' is mortally&lt;br /&gt;
    wounded, sleeping, fighting or whatever.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/addaff()&amp;diff=1073</id>
		<title>Manual:DIL Manual/addaff()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/addaff()&amp;diff=1073"/>
		<updated>2025-12-04T10:46:09Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpaddaff&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 addaff ( u : unitptr, id : integer, tif_first : integer, tif_tick : integer,&lt;br /&gt;
          tif_last : integer, apf : integer, )XXX&lt;br /&gt;
    u  : Unit to add affect to.&lt;br /&gt;
    id : Affect id to add, see ID_* in values.h and/or vme.h&lt;br /&gt;
    result: Adds affect 'id' at 'u' with first, tick, and last TIF_XXX's&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/integerlist&amp;diff=1072</id>
		<title>Manual:DIL Manual/integerlist</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/integerlist&amp;diff=1072"/>
		<updated>2025-12-04T10:46:00Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;intlist&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Intlist:'''&lt;br /&gt;
&lt;br /&gt;
   Intlists are an array of integer types.  They can be set directly as follows:&lt;br /&gt;
&lt;br /&gt;
 '''Example'''&lt;br /&gt;
&lt;br /&gt;
 wpn:={5,3,6,9,3,9};&lt;br /&gt;
&lt;br /&gt;
 The intlists can be accessed in the same way stringlist are accessed as follows.&lt;br /&gt;
&lt;br /&gt;
 '''Example'''&lt;br /&gt;
&lt;br /&gt;
 if (wpn.[5]==5)&lt;br /&gt;
 {&lt;br /&gt;
 do something&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 The intlists are saved on savable units.&lt;br /&gt;
&lt;br /&gt;
 '''Type:  '''&amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;intlist&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   This variable type allows you to keep an ordered list of integers with out&lt;br /&gt;
 having to create a variable for each integer.&lt;br /&gt;
 '''Example:'''  &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;Setting an intlist&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 myintlist:={1,5,9,2,8,5};&lt;br /&gt;
 myintlist.[10]:=50;&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   If you set a index that is higher then the highest index, every index in&lt;br /&gt;
 between will be set to zero.  For example if you only have two values in the&lt;br /&gt;
 intlist and you set index value 10 to 50 all indexes between 2 and 10 will be&lt;br /&gt;
 set to 0.&lt;br /&gt;
 '''Example:'''  &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;Using intlists&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 if (myintlist.[5]==5){&lt;br /&gt;
 stuff&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 if (myintlist&amp;amp;lt;myint){&lt;br /&gt;
 stuff&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 i:=0;&lt;br /&gt;
 ln:=length(myintlist);&lt;br /&gt;
 while (i&amp;amp;lt;ln){&lt;br /&gt;
 myintlist.[i]:=i;&lt;br /&gt;
 i:=i+1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 '''See Also:'''&lt;br /&gt;
 [[#bpinsert|Insert]]&lt;br /&gt;
 [[#bpremove|Remove]]&lt;br /&gt;
 [[#eptr|Extraptr]]&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/string&amp;diff=1071</id>
		<title>Manual:DIL Manual/string</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/string&amp;diff=1071"/>
		<updated>2025-12-04T10:45:54Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;str&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''String:'''&lt;br /&gt;
&lt;br /&gt;
    A string is some text. They are used for a lot of things such as command&lt;br /&gt;
 arguments, room descriptions etc. String variables are automatically resized and&lt;br /&gt;
 allocated when you assign them, so you do not have to worry about the string&lt;br /&gt;
 length nor allocation in your DIL programs. Strings may be compared either with&lt;br /&gt;
 '==' (equal to),&lt;br /&gt;
 '!=' (not equal),&lt;br /&gt;
 '&amp;lt;=' (less than or equal to),&lt;br /&gt;
 '&amp;gt;=' (greater than or equal to)&lt;br /&gt;
 '&amp;lt;' (less than),&lt;br /&gt;
  '&amp;gt;' (greater than.&lt;br /&gt;
&lt;br /&gt;
   Static strings are defined just as in the rest of the zone, within double&lt;br /&gt;
 quotations.  Strings may be searched easily with the 'in' operator.  Variables&lt;br /&gt;
 of type string are saved with DIL programs, if attached to a saved unit.&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   &amp;quot;This is a static string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 Strings may also be added to each other, in an expression.&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   &amp;quot;say &amp;quot;+itoa(42)+&amp;quot; is the answer!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   if (self.name == self.names.[1]) ...&lt;br /&gt;
&lt;br /&gt;
   Elements of the string can also be accessed by referencing them by their position.&lt;br /&gt;
&lt;br /&gt;
   '''Example'''&lt;br /&gt;
   if (str.[3]==f])&lt;br /&gt;
   {&lt;br /&gt;
   exec (&amp;quot;say The 4th element is a F.&amp;quot;,self);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   '''Note'''&lt;br /&gt;
   Currently you can only access the single elements of a string you can not set&lt;br /&gt;
 them.  In the future this will be possible.  You can still accomplish this by&lt;br /&gt;
 copying one string to the other one element at a time and changing any that you&lt;br /&gt;
 want something like this.&lt;br /&gt;
&lt;br /&gt;
 '''Example'''&lt;br /&gt;
 i:=0;&lt;br /&gt;
 ln:=length (str);&lt;br /&gt;
 while (str.[i]&amp;lt;ln)&lt;br /&gt;
 	{&lt;br /&gt;
 	if (str.[i]==&amp;quot;f&amp;quot;)&lt;br /&gt;
 	newstr.[i]:=&amp;quot;b&amp;quot;;&lt;br /&gt;
 	else&lt;br /&gt;
 	newstr:=str.[i];&lt;br /&gt;
 	i:=i+1;&lt;br /&gt;
 	}&lt;br /&gt;
 	str:=newstr;&lt;br /&gt;
&lt;br /&gt;
   This snip of Dil would replace any 'f' in a string with a 'b' remember dil is&lt;br /&gt;
 not case sensitive so it will also replace an 'F'.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/zoneptr&amp;diff=1070</id>
		<title>Manual:DIL Manual/zoneptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/zoneptr&amp;diff=1070"/>
		<updated>2025-12-04T10:45:32Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;zptr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Type:  '''&amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;zoneptr&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 '''Zone Pointer Fields'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''next'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         unitptr - pointer to next zoneptr&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''previous'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         unitptr - pointer to previous zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''creators'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         stringlist - list of creators&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''name'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         string - zone name (%zone)&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''title'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         string - zone title (title &amp;quot;&amp;quot;)&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''rooms'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         unitptr - pointer to the base room&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''objs'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         unitptr - pointer to the base objects of the zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''npcs'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         unitptr - pointer to base NPCs of the zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''resetmode'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer- reset mode of zone in 'values.h'&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''resettime'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the reset time of the zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''access'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the access level of the zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''loadlevel'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the loadlevel of the zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''payonly'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the paystatus of the zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''roomcount'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the number of rooms in a zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''objcount'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the numbner of objects in a zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''npccount'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         integer - the number of npcs/mobiles in a zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''fname'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         string - the filename of a zone&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''notes'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         string - the Zone Notes&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''help'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         string - the Zone Help&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   The 'zoneptr' works like a unitptr.  To get the first zoneptr in the global&lt;br /&gt;
 list of zones you use 'zhead'.&lt;br /&gt;
 '''Example: '''&amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;zoneptr := zhead();&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 '''Zone list command'''&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 dilbegin zonelist (arg:string);&lt;br /&gt;
 var&lt;br /&gt;
  z:zoneptr;&lt;br /&gt;
  buf:string;&lt;br /&gt;
 code&lt;br /&gt;
 {&lt;br /&gt;
           z:=zhead();&lt;br /&gt;
           while (z)&lt;br /&gt;
           {&lt;br /&gt;
           buf:=&amp;quot;Name:  &amp;quot;+z.name+&amp;quot;&amp;amp;amp;n&amp;quot;;&lt;br /&gt;
           buf:=buf+&amp;quot;Filename:  &amp;quot;+z.fname+&amp;quot;&amp;amp;amp;n&amp;quot;;&lt;br /&gt;
           buf:=buf+&amp;quot;Creator:  &amp;quot;+z.creators.[0]+&amp;quot;&amp;amp;amp;n&amp;quot;;&lt;br /&gt;
           buf:=buf+&amp;quot;Notes:  &amp;amp;amp;n&amp;quot;+z.notes+&amp;quot;&amp;amp;amp;n&amp;amp;amp;n&amp;quot;;&lt;br /&gt;
           z:=z.next;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
           pagestring (buf,self);&lt;br /&gt;
           quit;&lt;br /&gt;
 }&lt;br /&gt;
 dilend&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/isaff()&amp;diff=1069</id>
		<title>Manual:DIL Manual/isaff()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/isaff()&amp;diff=1069"/>
		<updated>2025-12-04T10:45:15Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfisaff&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 integer isaff ( u : unitptr , i : integer )&lt;br /&gt;
    u : A unit to be examined.&lt;br /&gt;
    i : An id of an affect, see ID_* in values.h and/or vme.h&lt;br /&gt;
    return: TRUE, if unit 'u' is affected by affect id 'i'&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/DIL_Constructs&amp;diff=1068</id>
		<title>Manual:DIL Manual/DIL Constructs</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/DIL_Constructs&amp;diff=1068"/>
		<updated>2025-12-04T10:45:12Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;const&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''DIL constructs:'''&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 DIL offers a set of construct for you to program with.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/asctime()&amp;diff=1067</id>
		<title>Manual:DIL Manual/asctime()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/asctime()&amp;diff=1067"/>
		<updated>2025-12-04T10:45:03Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfasctime&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 string asctime(i : integer)&lt;br /&gt;
    i : the time to convert in seconds ([[#bvrealtime|realtime]] variable)&lt;br /&gt;
&lt;br /&gt;
    Returns: The seconds converted into an ascii format date of the following&lt;br /&gt;
             form  &amp;quot;Mon Nov 18 18:49:08 1996&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Example:&lt;br /&gt;
       log(asctime(realtime));&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/PRE&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/meleedamage()&amp;diff=1066</id>
		<title>Manual:DIL Manual/meleedamage()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/meleedamage()&amp;diff=1066"/>
		<updated>2025-12-04T10:45:00Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfmeleedamage&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Function:  '''&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;meleedamage ( c : unitptr, v : unitptr, b : integer, wt : integer );&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''c'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the character that should make an additional attack&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''v'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the character being attacked&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''b'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         any penalty or bonus added to the attack.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''wt'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the weapon type of the attack, if a valid type then that is used for the attack purpose, otherwise the default weapon/hand attack is used.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''returns'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         The amount of damage done or -1 for failed&lt;br /&gt;
&lt;br /&gt;
 ch' performs an attack (using whatever weapon is wielded or his bare hands) against 'vict'.&lt;br /&gt;
 If wtype is within a valid weapon range (WPN_XXX) any weapon will be bypassed,&lt;br /&gt;
 and the value will be used as the attacktype.  Good for things like &amp;quot;meleeattack&lt;br /&gt;
 (ch, vict, bonus, WPN_CIRCLE_KICK)&amp;quot;  If you want person to be able to perform an&lt;br /&gt;
 extra attack even though wielding a weapon or something.  Note that this will&lt;br /&gt;
 require BOTH a weapon type WPN_CIRCLE_KICK and a skill &amp;quot;kick&amp;quot; in order for it to&lt;br /&gt;
 work.&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 dilbegin kick(arg : string);&lt;br /&gt;
 external&lt;br /&gt;
    provoked_attack (victim : unitptr, ch : unitptr);&lt;br /&gt;
&lt;br /&gt;
 var&lt;br /&gt;
    bonus : integer;&lt;br /&gt;
    targ  : unitptr;&lt;br /&gt;
&lt;br /&gt;
 code&lt;br /&gt;
 {&lt;br /&gt;
    if ((self.type == UNIT_ST_PC) and (self.weapons[WPN_KICK] &amp;amp;lt;= 0))&lt;br /&gt;
    {&lt;br /&gt;
       act(&amp;quot;You must practice first.&amp;quot;, A_ALWAYS, self, null, null, TO_CHAR);&lt;br /&gt;
       quit;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (arg == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
       if (self.fighting)&lt;br /&gt;
       {&lt;br /&gt;
          targ := self.fighting;&lt;br /&gt;
          goto kick;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
       act(&amp;quot;Kick who?&amp;quot;, A_SOMEONE, self, null, null, TO_CHAR);&lt;br /&gt;
       quit;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    targ := findunit(self, arg, FIND_UNIT_SURRO, null);&lt;br /&gt;
&lt;br /&gt;
    if ((targ == null) or not visible(self, targ))&lt;br /&gt;
    {&lt;br /&gt;
       act(&amp;quot;That person is not here!&amp;quot;, A_SOMEONE, self, null, null, TO_CHAR);&lt;br /&gt;
       quit;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (not (targ.type &amp;amp;amp; (UNIT_ST_PC | UNIT_ST_NPC)))&lt;br /&gt;
    {&lt;br /&gt;
       act(&amp;quot;You can't kick that, silly!&amp;quot;, A_SOMEONE, self, null, null,&lt;br /&gt;
           TO_CHAR);&lt;br /&gt;
       quit;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (targ == self)&lt;br /&gt;
    {&lt;br /&gt;
       act(&amp;quot;You kick yourself.&amp;quot;, A_HIDEINV, self, null, null,&lt;br /&gt;
           TO_CHAR);&lt;br /&gt;
       act(&amp;quot;$1n kicks $1mself.&amp;quot;, A_HIDEINV, self, null, null,&lt;br /&gt;
           TO_ROOM);&lt;br /&gt;
       quit;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ((targ.type==UNIT_ST_PC) and&lt;br /&gt;
    (self.type==UNIT_ST_PC))&lt;br /&gt;
   {&lt;br /&gt;
 if (not(isset (self.pcflags, PC_PK_RELAXED)))&lt;br /&gt;
   {&lt;br /&gt;
   act (&amp;quot;You are not allowed to do this unless you sign the book of blood.&amp;quot;,&lt;br /&gt;
   A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
   quit;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
 if (not(isset (targ.pcflags, PC_PK_RELAXED)))&lt;br /&gt;
   {&lt;br /&gt;
   act (&amp;quot;You are not allowed to do this unless $2e signs the book of blood.&amp;quot;,&lt;br /&gt;
   A_ALWAYS,self,targ,null,TO_CHAR);&lt;br /&gt;
   quit;&lt;br /&gt;
   }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    :kick:&lt;br /&gt;
    /* Penalty for wielding a weapon while kicking! */&lt;br /&gt;
    if (equipment(self, WEAR_WIELD))&lt;br /&gt;
      bonus := -25;&lt;br /&gt;
    else&lt;br /&gt;
      bonus := +25;&lt;br /&gt;
    if (self.endurance &amp;amp;lt; 2)&lt;br /&gt;
      act(&amp;quot;You are too exhausted to attempt that.&amp;quot;, A_ALWAYS, self, null,&lt;br /&gt;
          null, TO_CHAR);&lt;br /&gt;
    else self.endurance := self.endurance - 2;&lt;br /&gt;
    provoked_attack (targ, self);&lt;br /&gt;
    bonus := meleeattack(self, targ, (bonus+self.level), WPN_KICK);&lt;br /&gt;
    quit;&lt;br /&gt;
 }&lt;br /&gt;
 dilend&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/setweight()&amp;diff=1065</id>
		<title>Manual:DIL Manual/setweight()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/setweight()&amp;diff=1065"/>
		<updated>2025-12-04T10:44:46Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpsetweight&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 setweight( u : unitptr, i : integer )&lt;br /&gt;
    u : the unit on which you wish to alter the weight.&lt;br /&gt;
    i : the new weight&lt;br /&gt;
&lt;br /&gt;
    This is needed on for example drink-containers. I.e. if you wish to&lt;br /&gt;
    remove or add some liquid, you must also adjust the weight of the&lt;br /&gt;
    container, or you will mess up things.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/SFB_COM&amp;diff=1064</id>
		<title>Manual:DIL Manual/SFB COM</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/SFB_COM&amp;diff=1064"/>
		<updated>2025-12-04T10:44:40Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sfbcom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 SFB_COM            Combat message&lt;br /&gt;
&lt;br /&gt;
   When this flag is set, the routine gets activated whenever a combat is in&lt;br /&gt;
   progress. The unit containing the DIL program needs not be involved in the&lt;br /&gt;
   combat itself:&lt;br /&gt;
&lt;br /&gt;
      'activator'... is a unitptr to the PC/NPC about to hit someone else.&lt;br /&gt;
      'argument'.... is empty.&lt;br /&gt;
&lt;br /&gt;
       command(CMD_AUTO_COMBAT) will evaluate to TRUE.&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Ending_Notes&amp;diff=1063</id>
		<title>Manual:DIL Manual/Ending Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Ending_Notes&amp;diff=1063"/>
		<updated>2025-12-04T10:44:35Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;note&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 How 'Done' messages (SFB_DONE) are treated. Note that not all commands are&lt;br /&gt;
 implemented, if you are missing one, let Papi know and it will be created.&lt;br /&gt;
 See [[#docs/command.txt|commands.txt]] for details.&lt;br /&gt;
&lt;br /&gt;
This page last updated 03-27-2001, Ken Perry &amp;quot;Whistler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Pages&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/act()&amp;diff=1062</id>
		<title>Manual:DIL Manual/act()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/act()&amp;diff=1062"/>
		<updated>2025-12-04T10:44:27Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpact&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 The purpose of act is to send a message to a number of players '''present''' in&lt;br /&gt;
 a room.  The room is defined as the room containing the afore mentioned&lt;br /&gt;
 character (provided he himself is in the room, i.e. not in a closed&lt;br /&gt;
 container.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 '''Syntax:'''&lt;br /&gt;
&lt;br /&gt;
 act(message, visibility, char, medium, victim, to_whom);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '''message'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          - is a string that will be shown to other mobiles when the act is executed. To refer to the following arguments use the [[#formatters|formatters]] listed below.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '''visibility'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          - is an integer that defines what happens if the mobile that is about to receive the message can't see the activator.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;A_SOMEONE&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                If the receiver cannot see char, replace any reference to char with &amp;lt;i&amp;gt;someone&amp;lt;/i&amp;gt;.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;A_HIDEINV&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                If the receiver cannot see char, don't send the message at all.	Use this when missing vision should eliminate the perception of the action the message represent. One instance where it is used is in smile. You would need a ridiculously sensitive ear to hear, let alone percept that someone's smiling if you can't see them. Do not use it if 'sound' is inherent in the message.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;A_ALWAYS&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                Works exactly like &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;A_SOMEONE&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;, except that the receiver will see the message even when sleeping.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '''char'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          - is a unitptr, and the most important argument in the act. If this is not valid the act will never show, leaving mobiles without the message.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '''medium'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          - is a unit pointer, an integer or a string. Use this at your leisure.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '''victim'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          - is a unit pointer, an integer or a string. Certain flags in the next argument rely on the validity of victim.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '''to_whom'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          - is an integer that defines who gets the message.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;TO_ROOM&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                Sends the message to the entire room, excluding 'char'.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;TO_VICT&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                Sends to 'victim' only. 'victim' must be valid, naturally.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;TO_NOTVICT&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                Sends the message to the entire room, excluding 'char' and 'victim'.  Perfect for bystanders in a melee.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;TO_CHAR&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                Sends the message to 'char' and no one else.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;TO_ALL&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                Sends the message to everybody in the room.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;         &amp;lt;b&amp;gt;&amp;lt;!--CODE--&amp;gt;TO_REST&amp;lt;/b&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;                This is a bit different from the rest.  In sends the message to all other units in the local environment, excluding those inside 'char'.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span id=&amp;quot;formatters&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Act Formatters'''&lt;br /&gt;
&lt;br /&gt;
 Just as the description formatters, act has its own set of formatters that&lt;br /&gt;
 enable you to create generic messages that will be interpreted at run-time,&lt;br /&gt;
 lessening the load on you.&lt;br /&gt;
&lt;br /&gt;
 The format string is a normal message, containing some special characters:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '$$'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         will be sent to the receiver as a single `$'&lt;br /&gt;
&lt;br /&gt;
 '$', followed by a number and an extra character.&lt;br /&gt;
   '''The numbers:'''&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '1'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          means this formatter refers to the 'char' argument.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '2'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         means this formatter refers to the 'medium' argument.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; '3'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          means this formatter refers to the 'victim' argument.&lt;br /&gt;
&lt;br /&gt;
    '''The characters'''&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 'N'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          the formatter will be replaced with the name of the unit, or (depending on the visibility) 'something' or 'someone'.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 'a'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         'a' or 'an' depending on the name of the unit referred by the number.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 'e'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         'it', 'he' or 'she' depending on the gender of the unit referred by the number.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 'm'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         'it', 'him' or 'her' depending on the gender of the unit referred by the number.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 'n'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;          the formatter will be replaced with the title of the unit, or (depending on the visibility) 'something' or 'someone'.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 'p'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         'fighting', 'standing', 'sleeping', etc., depending on the positionof the unit referred by the number.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 's'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         'its', 'his' or 'her' depending on the gender of the unit referred by the number.&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt; 't'&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the string in the argument referred by the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   act(&amp;quot;You step over $2n.&amp;quot;, A_SOMEONE, self, litter, null, TO_CHAR);&lt;br /&gt;
   act(&amp;quot;$1n steps over $2n.&amp;quot;, A_SOMEONE, self, litter, null, TO_REST);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''See Also:'''&lt;br /&gt;
   [[#act.html|DIL Act() for Dummies]]&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unsecure()&amp;diff=1061</id>
		<title>Manual:DIL Manual/unsecure()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unsecure()&amp;diff=1061"/>
		<updated>2025-12-04T10:44:22Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpunsec&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 unsecure ( u : unitptr )&lt;br /&gt;
    u : Secured unit.&lt;br /&gt;
    result: Drop secure on a given unit.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unitptr&amp;diff=1060</id>
		<title>Manual:DIL Manual/unitptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/unitptr&amp;diff=1060"/>
		<updated>2025-12-04T10:44:15Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;unit&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''The unitptr has the following fields:'''&lt;br /&gt;
&lt;br /&gt;
    unitptr:&lt;br /&gt;
       'names'        :stringlist (RW)&lt;br /&gt;
          A list of names that matches the unit.&lt;br /&gt;
       'name'         :string (RW)&lt;br /&gt;
          The first name in the namelist in 'names'&lt;br /&gt;
       'outside_descr' :string (RW)&lt;br /&gt;
          The description of the unit from the 'outside'. f.inst.&lt;br /&gt;
          the description of a boat, seen from the outside.&lt;br /&gt;
       'inside_descr' :string (RW)&lt;br /&gt;
          The description of the unit from the 'inside'. f.inst.&lt;br /&gt;
          the description of a boat, seen from the inside.&lt;br /&gt;
       'next'         :unitptr (RO)&lt;br /&gt;
          The next unit in the local list of units. For instance, the&lt;br /&gt;
          units in the inventory of a PC, is linked with this field.&lt;br /&gt;
       'title'        :string (RW)&lt;br /&gt;
          The title of the unit.&lt;br /&gt;
       'extra'        :extraptr (RW)&lt;br /&gt;
          Extra descriptions of the unit (identify, look at, read etc.).&lt;br /&gt;
       'outside'      :unitptr (RO)&lt;br /&gt;
          The outside of the unit hierarchy (carried by, contained by).&lt;br /&gt;
          For instance, the contents of a bag have their 'outside'&lt;br /&gt;
          field pointing to the bag.&lt;br /&gt;
       'inside'       :unitptr (RO)&lt;br /&gt;
          The inside of the unit hierarchy (carry, contains).&lt;br /&gt;
          For instance the first unit in a PC's inventory is referenced&lt;br /&gt;
          by the 'inside' field.&lt;br /&gt;
       'key'       :string (RO)&lt;br /&gt;
          The key that will open this unitptr&lt;br /&gt;
          For instance &amp;quot;big_key@blackzon&amp;quot;&lt;br /&gt;
 		          by the 'inside' field.&lt;br /&gt;
       'gnext'        :unitptr (RO)&lt;br /&gt;
          Next unit in the global list of units.&lt;br /&gt;
       'gprevious'    :unitptr (RO)&lt;br /&gt;
          Previous unit in the global list of units.&lt;br /&gt;
       'hasfunc'      :integer (RO)&lt;br /&gt;
          Returns TRUE if unit has special functions attached to it.&lt;br /&gt;
       'max_hp'       :integer (RO/RW)&lt;br /&gt;
          The maximum hitpoints of unit, RO for players, RW for mobiles.&lt;br /&gt;
       'max_mana'       :integer (RO)&lt;br /&gt;
          The maximum mana of the character (player or mobile).&lt;br /&gt;
       'max_endurance'  :integer (RO)&lt;br /&gt;
          The maximum endurance of the character (player or mobile).&lt;br /&gt;
       'lifespan'       :integer (RW)&lt;br /&gt;
          The lifespan of a character, write permission only on root access.&lt;br /&gt;
       'hp'           :integer (RW)&lt;br /&gt;
          The current hitpoints of unit. For objects, this can render&lt;br /&gt;
          it 'broken' by being set low. If an unit has -1 hitpoints&lt;br /&gt;
          its considered unbreakable.&lt;br /&gt;
       'manipulate'   :integer (RW)&lt;br /&gt;
          Bits that specify how unit can be handled, see MANIPULATE_*&lt;br /&gt;
          flags in values.h and/or vme.h&lt;br /&gt;
       'flags'        :integer (RW)&lt;br /&gt;
          Bits that specify different properties of a unit, see&lt;br /&gt;
          UNIT_FL_* in values.h and/or vme.h&lt;br /&gt;
       'baseweight'   :integer (RO)&lt;br /&gt;
          The empty weight of the unit. This can be set with the&lt;br /&gt;
          procedure 'setweight()'&lt;br /&gt;
       'weight'       :integer (RO)&lt;br /&gt;
          The current weight of the unit (and its contents).&lt;br /&gt;
       'capacity'     :integer (RW)&lt;br /&gt;
          The amount of weight the unit can contain.&lt;br /&gt;
       'height'       :integer (RW)&lt;br /&gt;
          The height of a PC/NPC, the length of a rope, the size of weapons,&lt;br /&gt;
          armours, and shields.&lt;br /&gt;
       'alignment'    :integer (RW)&lt;br /&gt;
          The alignment of the unit. [1000..-1000],&lt;br /&gt;
          1000 is good, 0 is neutral, -1000 is evil.&lt;br /&gt;
       'openflags'    :integer (RW)&lt;br /&gt;
          Bits thats specify how a unit may be opened, locked, etc,&lt;br /&gt;
          see EX_* in values.&lt;br /&gt;
       'light'        :integer (RO)&lt;br /&gt;
          How much light is inside the unit.&lt;br /&gt;
       'bright'       :integer (RO)&lt;br /&gt;
          How much the unit lights up. This can be set with the&lt;br /&gt;
          procedure 'setbright()'&lt;br /&gt;
       'illum'        :integer (RO)&lt;br /&gt;
          How much light units inside a transparent unit create&lt;br /&gt;
       'minv'         :integer (RW)&lt;br /&gt;
          The 'wizard invisibility' level.&lt;br /&gt;
       'spells'[]     :integer (RO)&lt;br /&gt;
          The defence/skill of the different spell spheres/spells&lt;br /&gt;
          The index should be one of the SPL_* in values.h and/or vme.h&lt;br /&gt;
       'zoneidx'      :string (RO)&lt;br /&gt;
          The unique database name (in the zone) for this unit.&lt;br /&gt;
       'nameidx'      :string (RO)&lt;br /&gt;
          The unique database zone name for this unit.&lt;br /&gt;
       'idx'      :integer (RO)&lt;br /&gt;
          The unique database index (in the zone) for this unit.&lt;br /&gt;
          This provides a smart alternative to check for zoneidx&lt;br /&gt;
          and nameidx. Thus if (u1.idx == u2.idx) then&lt;br /&gt;
          (u1.nameidx == u2.nameidx) and (u1.zoneidx == u2.zoneidx).&lt;br /&gt;
          Be warned, this value change between each reboot, so do not&lt;br /&gt;
          count on it for purposes of saving.&lt;br /&gt;
       'zone'         :string (RO)&lt;br /&gt;
          The name of the zone the unit is in.&lt;br /&gt;
       'type'         :integer (RO)&lt;br /&gt;
          The type of the unit, see UNIT_ST_* in values.h and/or vme.h&lt;br /&gt;
       'loadcount'    :integer (RO)&lt;br /&gt;
          Returns the number of units loaded in the game&lt;br /&gt;
          of this definition (zoneidx,nameidx / idx)&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/secure()&amp;diff=1059</id>
		<title>Manual:DIL Manual/secure()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/secure()&amp;diff=1059"/>
		<updated>2025-12-04T10:44:03Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpsec&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 secure ( u : unitptr , label )&lt;br /&gt;
    u : Unit to secure.&lt;br /&gt;
    label : Label to jump to, on removal.&lt;br /&gt;
    result: Secures a unitptr, so that the program will go to 'label'&lt;br /&gt;
            if unit leaves local environment. If this happens, during&lt;br /&gt;
            a call to another function/procedure, it will continue&lt;br /&gt;
            at that label when the function/procedure returns.&lt;br /&gt;
            If you perform some kind of call to a template, the removing&lt;br /&gt;
            of a unit from the local environment will not have affect.&lt;br /&gt;
            until the return from that function, as the program execution&lt;br /&gt;
            will continue at the designated label after a call. Should&lt;br /&gt;
            several secured units leave local environment, the last such&lt;br /&gt;
            event will determine the point of execution upon return.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Built-In_Variables&amp;diff=1058</id>
		<title>Manual:DIL Manual/Built-In Variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Built-In_Variables&amp;diff=1058"/>
		<updated>2025-12-04T10:43:51Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;built_in&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''Built-in Variables:'''&amp;lt;/h3&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/dilcopy()&amp;diff=1056</id>
		<title>Manual:DIL Manual/dilcopy()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/dilcopy()&amp;diff=1056"/>
		<updated>2025-12-04T10:43:44Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpdc&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 dilcopy( s : string, u : unitptr )&lt;br /&gt;
    s : Name template to attach to unit.&lt;br /&gt;
    u : Unit to attach a dil program to.&lt;br /&gt;
    result: Attaches a DIL program to a unit 'u', which uses a template&lt;br /&gt;
            named by 's'.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/UNIT_ST_PC_and_UNIT_ST_NPC&amp;diff=1057</id>
		<title>Manual:DIL Manual/UNIT ST PC and UNIT ST NPC</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/UNIT_ST_PC_and_UNIT_ST_NPC&amp;diff=1057"/>
		<updated>2025-12-04T10:43:44Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;upcnpc&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''if the type is UNIT_ST_PC or UNIT_ST_NPC '''&lt;br /&gt;
&lt;br /&gt;
       'speed'        :integer (RO)&lt;br /&gt;
          The current default combat-speed (as seen by wstat)&lt;br /&gt;
       'fighting'     :unitptr (RO)&lt;br /&gt;
          The unit the PC/NPC is fighting.&lt;br /&gt;
       'master'       :unitptr (RO)&lt;br /&gt;
          The unit the PC/NPC is following.&lt;br /&gt;
       'follower'     :unitptr (RO)&lt;br /&gt;
          The first follower of a PC/NPC. There is currently no way&lt;br /&gt;
          of finding other followers, except using a foreach loop in&lt;br /&gt;
          the local environment.&lt;br /&gt;
       'exp'          :integer (RO)&lt;br /&gt;
          The number of experience points for PC, or experience&lt;br /&gt;
          quality of monster. The exp can be set by the function&lt;br /&gt;
          'experience()'&lt;br /&gt;
       'charflags'     :integer (RW)&lt;br /&gt;
          Bits specifying by spells affects and other PC/NPC affects,&lt;br /&gt;
          and many other things, see CHAR_* in values.h and/or vme.h&lt;br /&gt;
       'lastroom'     :unitptr (RO)&lt;br /&gt;
          The room the player just left.&lt;br /&gt;
       'mana'         :integer (RW)&lt;br /&gt;
          The amount of mana a PC/CHAR has left.&lt;br /&gt;
       'dex_red'      :integer (RO)&lt;br /&gt;
          The amount of DEX reduction the PC/NPC suffers due to&lt;br /&gt;
          encumbrance or otherwise.&lt;br /&gt;
       'endurance'    :integer (RW)&lt;br /&gt;
          The amount of endurance a PC/NPC has left.&lt;br /&gt;
       'attack_type'  :integer (RW)&lt;br /&gt;
          The non-weapon attack type of a PC/NPC.&lt;br /&gt;
       'race'         :integer (RW)&lt;br /&gt;
          The race of a PC/NPC, see RACE_* in values.h and/or vme.h&lt;br /&gt;
       'sex'          :integer (RW)&lt;br /&gt;
          The sex of a PC/NPC, see SEX_* in values.h and/or vme.h&lt;br /&gt;
       'level'        :integer (RO)&lt;br /&gt;
          The level of a PC/NPC.&lt;br /&gt;
       'position'     :integer (RW)&lt;br /&gt;
          The position of a PC/NPC, see POSITION_* in values.h and/or vme.h&lt;br /&gt;
          affected by the 'position_update()' procedure&lt;br /&gt;
       'abilities'[]  :integer (RO)&lt;br /&gt;
          The abilities of a PC/NPC. Index should be ABIL_* in values.h and/or vme.h&lt;br /&gt;
       'weapons'[]    :integer (RO)&lt;br /&gt;
          The weapon skills of a PC/NPC. Index should be WPN_* in values.h and/or vme.h&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/cmdptr&amp;diff=1055</id>
		<title>Manual:DIL Manual/cmdptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/cmdptr&amp;diff=1055"/>
		<updated>2025-12-04T10:43:32Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;cptr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Type:  '''&amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;cmdptr&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 '''cmdptr fields'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''name'''&lt;br /&gt;
             string - command name&lt;br /&gt;
 '''type'''&lt;br /&gt;
             integer - command type like social or skill or just command&lt;br /&gt;
 '''level'''&lt;br /&gt;
             integer - minimum level to use command&lt;br /&gt;
 '''loglevel'''&lt;br /&gt;
             integer - level of character that can see the log 0 for no logs&lt;br /&gt;
 '''position'''&lt;br /&gt;
             integer - minimum position to use command&lt;br /&gt;
 '''next'''&lt;br /&gt;
             cmdptr - pointer to the next cmdptr&lt;br /&gt;
 '''previous'''&lt;br /&gt;
             cmdptr - pointer to the previous cmdptr&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   The cmdptr can be used to search the command list or display all the commands.&lt;br /&gt;
 I0t is also now possible to sort the commands by type by defining your own command&lt;br /&gt;
 types and using the type field to sort on.&lt;br /&gt;
&lt;br /&gt;
   In order to get the first command in the list you use the following function:&lt;br /&gt;
 '''Function:  '''&amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;chead();&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 If you want to get a specific command then you use the following function:&lt;br /&gt;
 '''Function:  '''&amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;cmdptr := getcommand (s : string );&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 dilbegin cmdtst(arg : string);&lt;br /&gt;
 var&lt;br /&gt;
   cmd : cmdptr;&lt;br /&gt;
   st : string;&lt;br /&gt;
&lt;br /&gt;
 code&lt;br /&gt;
 {&lt;br /&gt;
    cmd := chead();&lt;br /&gt;
&lt;br /&gt;
 	  while (cmd)&lt;br /&gt;
         {&lt;br /&gt;
         st := cmd.name + &amp;quot; &amp;quot; + itoa(cmd.level) + &amp;quot; &amp;quot; + itoa(cmd.type) + &amp;quot; &amp;quot; +&lt;br /&gt;
         itoa(cmd.loglevel) + &amp;quot; &amp;quot; + itoa(cmd.position);&lt;br /&gt;
         act(&amp;quot;CMD: $2t&amp;quot;, A_ALWAYS, self, st, null, TO_CHAR);&lt;br /&gt;
         cmd := cmd.next;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
         cmd:=getcommand(&amp;quot;kick&amp;quot;);&lt;br /&gt;
         sendtext (&amp;quot;You must be &amp;quot;+itoa(cmd.level+&amp;quot; to use kick&amp;amp;amp;n&amp;quot;,self);&lt;br /&gt;
&lt;br /&gt;
            quit;&lt;br /&gt;
 }&lt;br /&gt;
 dilend&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/findsymbolic()&amp;diff=1054</id>
		<title>Manual:DIL Manual/findsymbolic()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/findsymbolic()&amp;diff=1054"/>
		<updated>2025-12-04T10:43:16Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bffinds&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 unitptr findsymbolic ( s : string )&lt;br /&gt;
    s : Symbolic name of the NPC or Object to find.&lt;br /&gt;
    return: A pointer to an instance of the unit, or null.&lt;br /&gt;
    Example: findsymbolic(&amp;quot;bread@midgaard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    This routine supplements findroom and findunit. It comes in handy,if it is&lt;br /&gt;
    important to get a correct reference to a NPC in the world.  If for example,&lt;br /&gt;
    Mary needs to send a message to John the Lumberjack,  then she should NOT&lt;br /&gt;
    use the findunit() since it may locate a different John - even a player!&lt;br /&gt;
    If she instead locates him using findsymbolic(&amp;quot;john@haon_dor&amp;quot;) she will be&lt;br /&gt;
    certain that it is in fact her husband, and not the player John Dow from&lt;br /&gt;
    Norway.  It will NOT locate rooms, for the only reason that findroom is a&lt;br /&gt;
    lot more efficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 unitptr findsymbolic ( u : unitptr, s : string, i : integer )&lt;br /&gt;
    u : Search is relative to this unit.&lt;br /&gt;
    s : Symbolic name of the NPC or Object to find.&lt;br /&gt;
    i : FIND_UNIT_XXX bit vector of places to search.&lt;br /&gt;
    return: A pointer to an instance of the unit, or null.&lt;br /&gt;
    Example: findsymbolic(self, &amp;quot;bread@midgaard&amp;quot;, FIND_UNIT_INVEN)&lt;br /&gt;
&lt;br /&gt;
    This routine supplements findroom, findunit and findsymbolic(#).  It comes in&lt;br /&gt;
    handy, if it is important to get a correct reference to a unit somewhere&lt;br /&gt;
    relative to 'u'.  If for example, Mary needs to check if she has her own&lt;br /&gt;
    cooking pot, then she should NOT use the findunit since it may locate a&lt;br /&gt;
    different pot, not belonging to Haon-Dor but to some other zone.  If she&lt;br /&gt;
    instead locates it using findsymbolic(self, &amp;quot;pot@haon_dor&amp;quot;, FIND_UNIT_IN_ME)&lt;br /&gt;
    she would be certain that it is in fact her own cooking pot that she is&lt;br /&gt;
    carrying around, and not some other pot from a Joe Blow's zone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 dilbegin zonelog (s:string);&lt;br /&gt;
 code&lt;br /&gt;
 {&lt;br /&gt;
 flog (self.zonidx+&amp;quot;.log&amp;quot;,s,&amp;quot;a&amp;quot;);&lt;br /&gt;
 return;&lt;br /&gt;
 }&lt;br /&gt;
 dilend&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 The previous DIL function will work in any zone to log to a file with that zones&lt;br /&gt;
  name each zone could use it to keep zone logs separate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Assignment&amp;diff=1053</id>
		<title>Manual:DIL Manual/Assignment</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Assignment&amp;diff=1053"/>
		<updated>2025-12-04T10:43:08Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;assgn&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''Assignment:'''&amp;lt;/h3&amp;gt;&lt;br /&gt;
     You can assign values to the variables you declare&lt;br /&gt;
     in your 'var' section, and some of the built-in&lt;br /&gt;
     variables. This is  done by the ':=' operator.&lt;br /&gt;
     Note that you can also assign a variable the result&lt;br /&gt;
     of an expression&lt;br /&gt;
     (the addition of strings below as an example)&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   dilbegin foo();&lt;br /&gt;
   var&lt;br /&gt;
     myvarsl : stringlist;&lt;br /&gt;
     myvars : string;&lt;br /&gt;
   code&lt;br /&gt;
   {&lt;br /&gt;
     :start:&lt;br /&gt;
     myvarsl := {&amp;quot;a string&amp;quot;,&amp;quot;another&amp;quot;,&amp;quot;the first&amp;quot;};&lt;br /&gt;
     myvars := self.name+&amp;quot; XX &amp;quot;;&lt;br /&gt;
     myvarsl.[2] := &amp;quot;the last&amp;quot;;&lt;br /&gt;
     myvarsl.[3] := &amp;quot;illegal&amp;quot;;  /* Will not work since [3] is not defined */&lt;br /&gt;
     pause;&lt;br /&gt;
     goto start:&lt;br /&gt;
   }&lt;br /&gt;
   dilend&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/SFB_PRE&amp;diff=1052</id>
		<title>Manual:DIL Manual/SFB PRE</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/SFB_PRE&amp;diff=1052"/>
		<updated>2025-12-04T10:43:02Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sfbpre&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 SFB_PRE            Command preprocessing&lt;br /&gt;
&lt;br /&gt;
   When this flag is set, the program is activated by a few special events&lt;br /&gt;
   which can then be blocked or changed. Currently, this event is triggered&lt;br /&gt;
   just prior to a spell being cast, and just prior to any sort of damage&lt;br /&gt;
   being given to a target.&lt;br /&gt;
&lt;br /&gt;
   PRE &amp;quot;command(CMD_CAST)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   Assume a a spell is cast from player A on player B with a scroll C.&lt;br /&gt;
&lt;br /&gt;
      'activator'... is a unitptr to A.&lt;br /&gt;
      'medium'   ... is a unitptr to C.&lt;br /&gt;
      'target'   ... is a unitptr to B.&lt;br /&gt;
&lt;br /&gt;
      command(CMD_CAST) will evaluate to TRUE.&lt;br /&gt;
&lt;br /&gt;
      'argument'.... will contain a number followed by any&lt;br /&gt;
                     argument to the spell itself. You should&lt;br /&gt;
                     parse this number, it equals the spell number SPL_XXX.&lt;br /&gt;
      'power' ....   is set to 'HM', i.e. how powerful the spell cast&lt;br /&gt;
                     is going to be. YOu can change this number at will.&lt;br /&gt;
                     If you decide to block the spell, you ought to set it&lt;br /&gt;
                     to -1.&lt;br /&gt;
&lt;br /&gt;
 Example:&lt;br /&gt;
    wait(SFB_PRE, command(CMD_CAST));&lt;br /&gt;
&lt;br /&gt;
    s := getword(argument);&lt;br /&gt;
    splno := atoi(s);&lt;br /&gt;
&lt;br /&gt;
    if (splno == SPL_FIREBALL_3)&lt;br /&gt;
      power := 0; /* No damage */&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   PRE &amp;quot;command(CMD_AUTO_DAMAGE)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   Assume that damage is given from player A to player B with a sword C.&lt;br /&gt;
&lt;br /&gt;
      'activator'... is a unitptr to A.&lt;br /&gt;
      'medium'   ... is a unitptr to C.&lt;br /&gt;
      'target'   ... is a unitptr to B.&lt;br /&gt;
&lt;br /&gt;
      command(CMD_AUTO_DAMAGE) will evaluate to TRUE.&lt;br /&gt;
&lt;br /&gt;
      'power' ....   is set to how much damage will be given. You can change&lt;br /&gt;
                     this number at will, but you should not set it to less&lt;br /&gt;
                     than zero.&lt;br /&gt;
&lt;br /&gt;
      'argument'.... will contain three numbers that you must parse to&lt;br /&gt;
                     determine what kind of damage we're talking about.&lt;br /&gt;
&lt;br /&gt;
                     First number is the attack group, this can be one of&lt;br /&gt;
                     MSG_TYPE_XXX from values.h and/or vme.h.&lt;br /&gt;
&lt;br /&gt;
                     Second number is dependant on the attack group and&lt;br /&gt;
                     identifies what damage compared to the group. For&lt;br /&gt;
                     example WPN_XXX for weapon group.&lt;br /&gt;
&lt;br /&gt;
                     Third number is the body hit location, one of WEAR_XXX,&lt;br /&gt;
                     (but not all of them, just hands, feet, legs, body, head,&lt;br /&gt;
                      arms, i.e. the armour positions, not positions like finger&lt;br /&gt;
                      or ear).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Example:&lt;br /&gt;
    wait(SFB_PRE, command(CMD_AUTO_DAMAGE));&lt;br /&gt;
&lt;br /&gt;
    s1 := getword(argument);&lt;br /&gt;
    grpno := atoi(s1);&lt;br /&gt;
&lt;br /&gt;
    s2 := getword(argument);&lt;br /&gt;
    atkno := atoi(s2);&lt;br /&gt;
&lt;br /&gt;
    s3 := getword(argument);&lt;br /&gt;
    hitloc := atoi(s3);&lt;br /&gt;
&lt;br /&gt;
    if (grpno == MSG_TYPE_SPELL)&lt;br /&gt;
    {&lt;br /&gt;
       if ((s2 == SPL_FINGER_DEATH))&lt;br /&gt;
       {&lt;br /&gt;
           act(&amp;quot;Your scarabaeus lights up as it protects your life force.&amp;quot;);&lt;br /&gt;
           power := -1;&lt;br /&gt;
           block;&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 '''&amp;lt;i&amp;gt;A note upon activating a DIL program&amp;lt;/i&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
 This is what you can't do:&lt;br /&gt;
&lt;br /&gt;
   If a DIL program is already active, e.g. it is sending a message or&lt;br /&gt;
   perhaps using &amp;quot;exec&amp;quot; to perform an action, then it can not be activated.&lt;br /&gt;
   Thus, any active DIL program is unable to catch further messages.&lt;br /&gt;
   Imagine this setting:&lt;br /&gt;
&lt;br /&gt;
   You have five program P1..P5. P1 sends a message, which is intercepted&lt;br /&gt;
   by P2. P2 now sends a message, but since P1 is busy it can not process&lt;br /&gt;
   the message. P3..P5 are however possible candidates.&lt;br /&gt;
   Assume P3 sends a message, and P4 acts upon it. P4 now sends a message&lt;br /&gt;
   and the ONLY program which can catch it is P5, since all the other programs&lt;br /&gt;
   are &amp;quot;busy&amp;quot;. If P5 sends a message no-one can act upon it. When P5&lt;br /&gt;
   returns, so does P4, P3, P2 and finally P1.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/send()&amp;diff=1051</id>
		<title>Manual:DIL Manual/send()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/send()&amp;diff=1051"/>
		<updated>2025-12-04T10:42:59Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpsend&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 send ( s : string )&lt;br /&gt;
    s : Message to send.&lt;br /&gt;
    result: Send a message to all DIL programs in current local environment,&lt;br /&gt;
            matching the message class SFB_MSG. The message is not received&lt;br /&gt;
            by those DIL programs in the local environment that is not set up&lt;br /&gt;
            to wait for that message class.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Expressions&amp;diff=1050</id>
		<title>Manual:DIL Manual/Expressions</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Expressions&amp;diff=1050"/>
		<updated>2025-12-04T10:42:44Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;express&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''Expressions:'''&amp;lt;/h3&amp;gt;&lt;br /&gt;
   The expressions used in assignment can return any&lt;br /&gt;
   of the types you can declare variables. Also they might return&lt;br /&gt;
   fail or null. An expression returning fail will not result&lt;br /&gt;
   in any action being taken. Fail is returned when you&lt;br /&gt;
   request a field from a null pointer, or the like.&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   dilbegin foo();&lt;br /&gt;
   var&lt;br /&gt;
     myvarsl : stringlist;&lt;br /&gt;
     myvars : string;&lt;br /&gt;
     myvarint : integer;&lt;br /&gt;
     myvaredp : extraptr;&lt;br /&gt;
     myvarunit : unitptr;&lt;br /&gt;
   code&lt;br /&gt;
   {&lt;br /&gt;
     :start:&lt;br /&gt;
     myvarunit := self.inside.next;&lt;br /&gt;
     myvarsl := {&amp;quot;a string&amp;quot;,&amp;quot;another&amp;quot;,&amp;quot;the last&amp;quot;};&lt;br /&gt;
     myvars := self.name+&amp;quot; XX &amp;quot;+itoa(self.hp);&lt;br /&gt;
     myvarint := activator.hp;&lt;br /&gt;
     myvaredp := &amp;quot;Rabbit Stew Complete&amp;quot; in activator.quests;&lt;br /&gt;
     pause;&lt;br /&gt;
     goto start:&lt;br /&gt;
   }&lt;br /&gt;
   dilend&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/send_done()&amp;diff=1049</id>
		<title>Manual:DIL Manual/send done()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/send_done()&amp;diff=1049"/>
		<updated>2025-12-04T10:42:38Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpsend_done&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Function:'''&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
 send_done( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);&amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''c'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the command string that is sending the message&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''a'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the unitptr (activator) that activated the message&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''m'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the unitptr (medium) that the Dil is acting through&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''t'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the unitptr (target) the Dil is acting on&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''p'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the power of the message&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''arg'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the argument sent with the message&lt;br /&gt;
 &amp;lt;!--TERM--&amp;gt;  '''o'''&lt;br /&gt;
 &amp;lt;!--DEFINITION--&amp;gt;         the unitptr (other) you also want the message to go to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   This sends the 'SFB_DONE' message to any dils that are waiting for it in the&lt;br /&gt;
   surrounding area and to the other pointer if not null.  The following is just&lt;br /&gt;
   one example you can find many more in '''commands.zon'''&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;lt;!--CODE--&amp;gt;&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 dilbegin do_read (arg:string);&lt;br /&gt;
 var&lt;br /&gt;
 brdname:string;&lt;br /&gt;
         i:integer;&lt;br /&gt;
         u:unitptr;&lt;br /&gt;
         x:extraptr;&lt;br /&gt;
         ln:integer;&lt;br /&gt;
         temp:string;&lt;br /&gt;
         templist:stringlist;&lt;br /&gt;
         buff:string;&lt;br /&gt;
         f_name:string;&lt;br /&gt;
         act_str:string;&lt;br /&gt;
 code&lt;br /&gt;
 {&lt;br /&gt;
 i:=atoi (arg);&lt;br /&gt;
 if (i&amp;amp;lt;0)&lt;br /&gt;
         {&lt;br /&gt;
         exec (&amp;quot;look &amp;quot;+arg,self);&lt;br /&gt;
         goto read_quit;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
 if (itoa (i)!=arg)&lt;br /&gt;
         {&lt;br /&gt;
         exec (&amp;quot;look &amp;quot;+arg,self);&lt;br /&gt;
         goto read_quit;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
 u:=self.outside.inside;&lt;br /&gt;
 while (u!=null)&lt;br /&gt;
         {&lt;br /&gt;
         if ((u.type==UNIT_ST_OBJ) and (u.objecttype==ITEM_BOARD))&lt;br /&gt;
                 break;&lt;br /&gt;
         u:=u.next;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
 if (u==null)&lt;br /&gt;
         {&lt;br /&gt;
         act (&amp;quot;You do not see that here.&amp;quot;,A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
         quit;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
                 if (u.extra.[&amp;quot;$BOARD_L_RES&amp;quot;].descr!=&amp;quot;&amp;quot;)&lt;br /&gt;
                 {&lt;br /&gt;
                 act_str:=u.extra.[&amp;quot;$BOARD_L_RES&amp;quot;].descr(self,u);&lt;br /&gt;
                 if (act_str!=&amp;quot;&amp;quot;)&lt;br /&gt;
                 {&lt;br /&gt;
         act(act_str,&lt;br /&gt;
                         A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
                 quit;&lt;br /&gt;
                 }&lt;br /&gt;
                 }&lt;br /&gt;
&lt;br /&gt;
 brdname:=u.names.[length (u.names)-1];&lt;br /&gt;
 i:=loadstr (brdname+&amp;quot;.idx&amp;quot;,temp);&lt;br /&gt;
 if (i&amp;amp;lt;=0)&lt;br /&gt;
         {&lt;br /&gt;
         act (&amp;quot;But the board is empty!&amp;quot;,&lt;br /&gt;
                 A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
         goto read_quit;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
 templist:=split(temp,&amp;quot;&amp;amp;amp;x&amp;quot;);&lt;br /&gt;
 ln:=length (templist);&lt;br /&gt;
 x:=&amp;quot;$BOARD_MAX&amp;quot; in self.extra;&lt;br /&gt;
 if ((atoi(arg)&amp;gt;atoi(x.descr)) or&lt;br /&gt;
 (atoi(arg)&amp;gt;ln))&lt;br /&gt;
         {&lt;br /&gt;
         act(&amp;quot;That message exists only within the boundaries of your mind.&amp;quot;,&lt;br /&gt;
                 A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
         goto read_quit;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
 i:=atoi(arg);&lt;br /&gt;
 temp:=templist.[i-1];&lt;br /&gt;
 f_name:=getword(temp);&lt;br /&gt;
 i:=loadstr (brdname+&amp;quot;.&amp;quot;+f_name,buff);&lt;br /&gt;
 if (i==0)&lt;br /&gt;
         {&lt;br /&gt;
         sendtext(&amp;quot;You have to let the poster finish the post before reading it.&amp;quot;,self);&lt;br /&gt;
         quit;&lt;br /&gt;
         }&lt;br /&gt;
 if (i&amp;amp;lt;1)&lt;br /&gt;
         {&lt;br /&gt;
         log(&amp;quot;05: Error when loading board info.&amp;quot;);&lt;br /&gt;
         act (&amp;quot;This board is not working report to an Administrator&amp;quot;,&lt;br /&gt;
                 A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
                 quit;&lt;br /&gt;
                 }&lt;br /&gt;
&lt;br /&gt;
 templist:=split(f_name,&amp;quot;.&amp;quot;);&lt;br /&gt;
 if (length(templist)&amp;amp;lt;2)&lt;br /&gt;
         act (&amp;quot;Message &amp;quot;+arg+&amp;quot;:  &amp;quot;+temp,&lt;br /&gt;
                 A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
 else&lt;br /&gt;
         act (&amp;quot;Message &amp;quot;+arg+&amp;quot;:  Re:  &amp;quot;+temp,&lt;br /&gt;
                 A_ALWAYS,self,null,null,TO_CHAR);&lt;br /&gt;
&lt;br /&gt;
 pagestring(buff,self);&lt;br /&gt;
&lt;br /&gt;
 :read_quit:&lt;br /&gt;
  send_done(&amp;quot;read&amp;quot;,self,null,u,0,arg,null);&lt;br /&gt;
 quit;&lt;br /&gt;
 }&lt;br /&gt;
 dilend&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/i&amp;gt;&amp;lt;!--ENDCODE--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extraptr&amp;diff=1048</id>
		<title>Manual:DIL Manual/extraptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extraptr&amp;diff=1048"/>
		<updated>2025-12-04T10:42:32Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;eptr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Extraptr:'''&lt;br /&gt;
&lt;br /&gt;
   Extra descriptions, quests structures, etc can be searched and manipulated&lt;br /&gt;
 using variables of this type. There is no way to declare static structures of&lt;br /&gt;
 this type in DIL programs. Lists of extra descriptions are easily searched with&lt;br /&gt;
 the 'in' operator (See below).  Extraptr variables are 'volatile', and thus&lt;br /&gt;
 cleared whenever there is a possibility that they are rendered unusable.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/stringlist&amp;diff=1047</id>
		<title>Manual:DIL Manual/stringlist</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/stringlist&amp;diff=1047"/>
		<updated>2025-12-04T10:42:23Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;strl&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''Stringlist:'''&lt;br /&gt;
&lt;br /&gt;
   A stringlist is a list of separate strings. This is used for things such as&lt;br /&gt;
 (multiple) names or keywords. You may request a specified word in a stringlist&lt;br /&gt;
 by its number.&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   mystring := self.names.[2];&lt;br /&gt;
&lt;br /&gt;
   Returning null if out of bounds of the stringlist (see 'length()'). Static&lt;br /&gt;
 stringlists are defined just as in the rest of the zonefile, as a comma separated&lt;br /&gt;
 list of static strings within curly brackets.&lt;br /&gt;
&lt;br /&gt;
 '''Example:'''&lt;br /&gt;
&lt;br /&gt;
   mysrtringlist := {&amp;quot;Some string&amp;quot;,&amp;quot;another string&amp;quot;,&amp;quot;the last string&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
   Stringlists are modified through the 'addstring()' and 'substring()' procedures.&lt;br /&gt;
 Stringlists are searched easily by the 'in' operator. See documentation below.&lt;br /&gt;
 They can also be set directly (see example above).  Variables of type string are&lt;br /&gt;
 saved with DIL programs, if attached to a saved unit.&lt;br /&gt;
&lt;br /&gt;
   Elements of each separate string in a stringlist can be accessed by appending&lt;br /&gt;
 a separate position at the end of the request for a string as follows:&lt;br /&gt;
&lt;br /&gt;
 '''Example'''&lt;br /&gt;
 if (strlist.[5].[3]==&amp;quot;b&amp;quot;){&lt;br /&gt;
 do something&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 '''Note'''&lt;br /&gt;
   See the strings for more information on accessing a single element.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extraptr&amp;diff=1046</id>
		<title>Manual:DIL Manual/extraptr</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extraptr&amp;diff=1046"/>
		<updated>2025-12-04T10:42:07Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;extra&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 '''The extraptr has the following fields:'''&lt;br /&gt;
&lt;br /&gt;
    extraptr:&lt;br /&gt;
       'names'        :stringlist (RW)&lt;br /&gt;
          names is a list of strings of names, that the extra description matches on.&lt;br /&gt;
       'descr'        :string (RW)&lt;br /&gt;
          descr is the contents of the extra description.&lt;br /&gt;
       'next'         :extraptr (RO)&lt;br /&gt;
          next is the next extra description in a list.&lt;br /&gt;
       'vals'        :intlist (RW)&lt;br /&gt;
          vals is a list of integer values attached to this extra.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;br /&gt;
&lt;br /&gt;
 The unitptr is the key structure in the MUD, containing any kind of the&lt;br /&gt;
 following subtypes:&lt;br /&gt;
&lt;br /&gt;
    object      : a normal object, a sword, a vail, etc.&lt;br /&gt;
    room        : a room, location or the like.&lt;br /&gt;
    pc          : a playing character.&lt;br /&gt;
    npc         : a non playing character (mobile, monster, etc)&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/findroom()&amp;diff=1045</id>
		<title>Manual:DIL Manual/findroom()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/findroom()&amp;diff=1045"/>
		<updated>2025-12-04T10:42:05Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bffindr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 unitptr findroom ( s : string )&lt;br /&gt;
    s : Symbolic name of room.&lt;br /&gt;
    return: A pointer to the room, or null&lt;br /&gt;
    Example: findroom(&amp;quot;inn@udgaard&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/medium&amp;diff=1044</id>
		<title>Manual:DIL Manual/medium</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/medium&amp;diff=1044"/>
		<updated>2025-12-04T10:42:04Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;medium&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 'medium'&lt;br /&gt;
    This variable is a unit pointer to the unit which was used during an&lt;br /&gt;
    operation. For 'done' messages this could for example be a bag which&lt;br /&gt;
    was the medium in a get operation.&lt;br /&gt;
    See description of messages for more information.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/meleeattack()&amp;diff=1043</id>
		<title>Manual:DIL Manual/meleeattack()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/meleeattack()&amp;diff=1043"/>
		<updated>2025-12-04T10:41:51Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bfmelee&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 integer meleeattack ( ch : unitptr, vict : unitptr,&lt;br /&gt;
                      bonus : integer, wtype : integer )&lt;br /&gt;
    ch    : The character which should make an additional attack.&lt;br /&gt;
    vict  : The victim of the attack.&lt;br /&gt;
    bonus : Any penalty or bonus added to the attack.&lt;br /&gt;
    wtype : The weapon type of the attack, if a valid type then that is&lt;br /&gt;
            used for the attack purpose, otherwise the default weapon/hand&lt;br /&gt;
            attack is used.&lt;br /&gt;
&lt;br /&gt;
    result: 'ch' performs a melee attack (using whatever weapon is wielded&lt;br /&gt;
            or his bare hands) against 'vict'. Returns the amount of damage&lt;br /&gt;
            given (-1 is failed).&lt;br /&gt;
&lt;br /&gt;
    If wtype is within a valid weapon range (WPN_XXX) any weapon will&lt;br /&gt;
    be bypassed, and the value will be used as the attacktype. Good&lt;br /&gt;
    for things like &amp;quot;meleeattack(ch, vict, bonus, WPN_CIRCLE_KICK)&amp;quot;&lt;br /&gt;
    if you want person to be able to perform an extra attack even&lt;br /&gt;
    though wielding a weapon or something. Note that this will require&lt;br /&gt;
    BOTH a weapon type WPN_CIRCLE_KICK and a skill &amp;quot;kick&amp;quot; in order for&lt;br /&gt;
    it to work.&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/self&amp;diff=1042</id>
		<title>Manual:DIL Manual/self</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/self&amp;diff=1042"/>
		<updated>2025-12-04T10:41:33Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;self&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 'self'&lt;br /&gt;
    This variable is a unitptr to the unit owning the DIL program.&lt;br /&gt;
    For C++ people, this is like the 'this' pointer.&lt;br /&gt;
    For example, if Mary has a program, then self.title equals&lt;br /&gt;
    &amp;quot;Mary the Lumberjack wife&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/addextra()&amp;diff=1041</id>
		<title>Manual:DIL Manual/addextra()</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/addextra()&amp;diff=1041"/>
		<updated>2025-12-04T10:41:31Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;bpaddex&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 addextra ( var e : extraptr, l : stringlist , s : string )&lt;br /&gt;
    e : Extra description list to add element to.&lt;br /&gt;
    l : Stringlist for the .names field.&lt;br /&gt;
    s : String for the .descr field.&lt;br /&gt;
    result: Adds an extra description to a list of extra descriptions.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strong&amp;gt;CAVEAT&amp;lt;/strong&amp;gt; builder: You cannot use an extraptr variable as the e&lt;br /&gt;
 argument, but you may continue to use the following form:&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    addextra (self.quests, &amp;quot;Bozo's Quest&amp;quot;);&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Operators&amp;diff=1040</id>
		<title>Manual:DIL Manual/Operators</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/Operators&amp;diff=1040"/>
		<updated>2025-12-04T10:41:26Z</updated>

		<summary type="html">&lt;p&gt;Papi: XML import of LLM wiki pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;ops&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;h3&amp;gt;'''Operators:'''&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   DIL features many other operators. For integers,&lt;br /&gt;
   '&amp;lt;', '&amp;gt;', '&amp;lt;=', '&amp;gt;=', '!=' '==' signify less than,&lt;br /&gt;
   greater than, less or equal, greater or equal, not equal,&lt;br /&gt;
   and equality operators. Furthermore, you can compare&lt;br /&gt;
   strings with '==' or '$=' for equality test, and '!='&lt;br /&gt;
   for non equality. Pointers may also use '==' and '!='&lt;br /&gt;
   and you may force DIL to compare pointers, even for&lt;br /&gt;
   strings with the '#=' pointer-equality operator.&lt;br /&gt;
   The '$=' and '#=' is considered obsolete, and only&lt;br /&gt;
   used for backward compatibility.&lt;br /&gt;
&lt;br /&gt;
 ---~---~---~---~---~---~---~---~---&lt;/div&gt;</summary>
		<author><name>Papi</name></author>
		
	</entry>
</feed>