<?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%2Fgetinteger%28%29</id>
	<title>Manual:DIL Manual/getinteger() - 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%2Fgetinteger%28%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/getinteger()&amp;action=history"/>
	<updated>2026-11-22T20:07:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/getinteger()&amp;diff=3047&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/getinteger()&amp;diff=3047&amp;oldid=prev"/>
		<updated>2026-11-14T23:20:49Z</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;= getinteger() =&lt;br /&gt;
'''Function''' (integer). Gets one of several numbers that the server computes, chosen by an index.&lt;br /&gt;
&lt;br /&gt;
 getinteger(what : integer, u : unitptr, i : integer)&lt;br /&gt;
&lt;br /&gt;
A way into server calculations that have no function of their own: a character's regeneration,&lt;br /&gt;
the experience a level needs, the real date and so on. &amp;lt;code&amp;gt;what&amp;lt;/code&amp;gt; says which; some take&lt;br /&gt;
the unit &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt;, some the number &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, and the rest ignore both (pass&lt;br /&gt;
&amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; and 0).&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| what || integer || Which number, a &amp;lt;code&amp;gt;DIL_GINT_&amp;lt;/code&amp;gt; constant from &amp;lt;code&amp;gt;vme/include/values.h&amp;lt;/code&amp;gt; (table below).&lt;br /&gt;
|-&lt;br /&gt;
| u || unitptr || The unit it is about, or null.&lt;br /&gt;
|-&lt;br /&gt;
| i || integer || The number it is about, or 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! what !! uses !! gives&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_EFFDEX&amp;lt;/code&amp;gt; (0) || u || The character's effective dexterity: lowered by the armour worn, less so with the skill for that armour.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_REQXP&amp;lt;/code&amp;gt; (1) || i || The experience needed to reach level &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;; 0 for 0 or less.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_LEVELXP&amp;lt;/code&amp;gt; (2) || i || The experience from level &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; to the next.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_DESCRIPTOR&amp;lt;/code&amp;gt; (3) || u || 0 when &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; is a player with no connection (link-dead); 1 for anything else, null too.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_CRIMENO&amp;lt;/code&amp;gt; (4) || || A new crime serial number.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_MANAREG&amp;lt;/code&amp;gt; (5) || u || The mana the character regains per regeneration tick.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_HITREG&amp;lt;/code&amp;gt; (6) || u || The hit points the character regains per regeneration tick.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_MOVEREG&amp;lt;/code&amp;gt; (7) || u || The endurance the character regains per regeneration tick.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_BONUS_A&amp;lt;/code&amp;gt; (8) || i || A &amp;lt;code&amp;gt;BONUS_&amp;lt;/code&amp;gt; value (-7 to 7) as a skill bonus, about -20 to +20, with a small random part.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_BONUS_B&amp;lt;/code&amp;gt; (9) || i || A &amp;lt;code&amp;gt;BONUS_&amp;lt;/code&amp;gt; value as an ability bonus, about -10 to +10, with a small random part.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_REALYEAR&amp;lt;/code&amp;gt; (10) || || The real year (UTC).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_REALMONTH&amp;lt;/code&amp;gt; (11) || || The real month, 1 to 12 (UTC).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_REALDAY&amp;lt;/code&amp;gt; (12) || || The real day of the month (UTC).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_PRESSURE&amp;lt;/code&amp;gt; (13) || u || The air pressure in millibars in the zone &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; is in (the zone of the program's own unit when null).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DIL_GINT_PRESSURECHG&amp;lt;/code&amp;gt; (14) || u || How much that pressure changed at the last weather update.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Integer: the number asked for. The ones about a character give 0 when &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; is null or&lt;br /&gt;
not a character. An unknown &amp;lt;code&amp;gt;what&amp;lt;/code&amp;gt; fails and is written to the log; a failed&lt;br /&gt;
argument makes it fail too.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* A &amp;lt;code&amp;gt;BONUS_&amp;lt;/code&amp;gt; value outside -7 to 7 is taken as -7 or 7, and logged.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer xp_to_go(pc : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   need : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (pc.type != UNIT_ST_PC)&lt;br /&gt;
      return (0);&lt;br /&gt;
   need := getinteger(DIL_GINT_REQXP, null, pc.vlevel + 1);&lt;br /&gt;
   if (need &amp;lt;= pc.exp)&lt;br /&gt;
      return (0);&lt;br /&gt;
   return (need - pc.exp);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells how much experience a player still needs for the next level, using the same table as&lt;br /&gt;
death.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/weather|weather]]&lt;br /&gt;
* [[Manual:DIL Manual/realtime|realtime]]&lt;br /&gt;
* [[Manual:DIL Manual/logcrime()|logcrime()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>