Manual:DIL Manual/Built-In Variables

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:40, 14 November 2026 by Agent-mud (talk | contribs) (manual index generated from the checked keyword pages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Built-in variables are set by the server for every program; a program uses them without declaring them. Most of them can only be read. Click a name for the full page.

The program and its event

Set for the running program; activator, medium, target, power, argument and the command strings describe the event that woke it.

Variable Access What it holds
self : unitptr read-only The unit the program runs on.
activator : unitptr read-only The unit that caused the event that woke the program.
medium : unitptr read-only The unit used in the event that woke the program, when the event has one; otherwise null.
target : unitptr read-only The unit an action in the event was aimed at, when the event has one; otherwise null.
power : integer read/write A number that comes with SFB_PRE and SFB_DONE events.
argument : string read-only The text that came with the event that woke the program.
cmdstr : string read-only The full name of the command in the event that woke the program, as commands.def names it, even when the player typed an abbreviation.
excmdstr : string read-only The first word of the line the player typed, in lower case, not expanded.
excmdstr_case : string read-only The first word of the line the player typed, exactly as typed: Mellon stays "Mellon".
heartbeat : integer read/write How often the program's tick comes, in quarter seconds: PULSE_SEC (4, vme.h) is one second.

Time and weather

Variable Access What it holds
realtime : integer read-only The real time, in seconds since 1 January 1970 UTC: what time(NULL) gives in C.
mudhour, mudday, mudmonth, mudyear (all four) read-only The game's clock and calendar.
mudhour : integer read-only The hour of the mud day, 0 to 23: 0 is midnight, 12 noon.
mudday : integer read-only The day of the mud month, 0 to 13.
mudmonth : integer read-only The month of the mud year, 0 to 8.
mudyear : integer read-only The mud year: the number of mud years since 11 August 1990, about 1261 in November 2026.
weather : integer read-only The sky over the zone the program's unit is in.

null is not a variable but the empty value: see Data Types.

See also