<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fexptol</id>
	<title>Manual:DIL Manual/exptol - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fexptol"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/exptol&amp;action=history"/>
	<updated>2026-11-23T22:04:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/exptol&amp;diff=2946&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/exptol&amp;diff=2946&amp;oldid=prev"/>
		<updated>2026-11-14T23:14:26Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= exptol =&lt;br /&gt;
'''Field''' (integer, read-only; units: PC).&lt;br /&gt;
&lt;br /&gt;
 pc.exptol : integer&lt;br /&gt;
&lt;br /&gt;
The experience a player still needs for the next level: the experience required for [[Manual:DIL Manual/vlevel|vlevel]] + 1 minus [[Manual:DIL Manual/exp|exp]]. At 0 or below the player can use the &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Use it on players only. On an NPC it crashes the server: the code takes any character and then reads the player-only virtual level (dilfld.cpp, &amp;lt;code&amp;gt;DILF_EXPTOL&amp;lt;/code&amp;gt;). Test &amp;lt;code&amp;gt;u.type == UNIT_ST_PC&amp;lt;/code&amp;gt; first.&lt;br /&gt;
* On an object, a room or null it fails.&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;). It changes when &amp;lt;code&amp;gt;exp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vlevel&amp;lt;/code&amp;gt; does.&lt;br /&gt;
* The experience a level needs is also available as &amp;lt;code&amp;gt;getinteger(DIL_GINT_REQXP, null, level)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin string level_status(pc : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (pc.type != UNIT_ST_PC)&lt;br /&gt;
      return (&amp;quot;&amp;quot;);&lt;br /&gt;
   if (pc.exptol &amp;lt;= 0)&lt;br /&gt;
      return (&amp;quot;You can now advance a level - congratulations!&amp;quot;);&lt;br /&gt;
   return (&amp;quot;You need &amp;quot; + itoa(pc.exptol) + &amp;quot; experience points to the next level.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells a player how far the next level is, as &amp;lt;code&amp;gt;score&amp;lt;/code&amp;gt; does in commands.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/exp|exp]]&lt;br /&gt;
* [[Manual:DIL Manual/vlevel|vlevel]]&lt;br /&gt;
* [[Manual:DIL Manual/experience()|experience()]]&lt;br /&gt;
* [[Manual:DIL Manual/getinteger()|getinteger()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>