Coverage index
Every built-in function and language feature is demonstrated in at least one worked example in this guide. This index maps each one to the chapter(s) that show it, so you can jump straight to a usage. For the precise definition of any entry, follow it to the reference or specification.
Chapter numbers: 1 Reacting to events · 2 Talking and messaging · 3 Finding things · 4 Inspecting entities · 5 Numbers, text, and logic · 6 Variables and memory · 7 Changing the world · 8 Combat and death · 9 Structuring scripts.
Predicates
| Built-in | Chapters |
|---|---|
exists |
4, 7 |
isnull |
3, 4, 6 |
ismob |
3, 4 |
isplayer |
1, 3, 6, 8 |
isobj |
4 |
isfighting |
4, 8 |
isholding |
4 |
iswearing |
4 |
hastag |
6 |
random |
5, 8 |
keyword |
1, 3, 6 |
abbrev |
1 |
streqi |
1, 5, 9 |
isabbrev |
5 |
location |
4 |
cansee |
3 |
Entity queries and accessors
| Built-in | Chapters |
|---|---|
name |
2, 3, 4 (and throughout) |
vnum |
7 |
level |
1, 5, 9 |
room |
3, 4, 7 |
class |
4, 5 |
alignment |
4 |
gen |
4 |
position |
4, 8 |
carrier |
4 |
he |
2 |
him |
2 |
his |
2 |
hour |
4, 7 |
moonphase |
4 |
Collection producers
| Built-in | Chapters |
|---|---|
creatures |
3, 6, 8, 9 |
people |
3, 6 |
objects |
3, 4 |
contents |
3 |
inventory |
4 |
equipment |
3 |
implants |
3 |
tattoos |
3 |
fighting |
8 |
alias |
3 |
words |
3, 5, 9 |
list |
5 |
Iterable consumers
| Built-in | Chapters |
|---|---|
empty |
3, 8 |
first |
3, 4, 8 |
nth |
3 |
count |
3, 4, 8, 9 |
ismember |
3 |
hasabbrev |
3 |
choose |
3, 5 |
each |
3, 6, 9 |
every |
3 |
some |
3, 8 |
select |
3, 9 |
slice |
3 |
Math, string, and conversion
| Built-in | Chapters |
|---|---|
int |
5 |
randrange |
5 |
substr |
5 |
upper |
5, 9 |
lower |
5 |
Prototype retrieval
| Built-in | Chapters |
|---|---|
mob |
7 |
object |
7 |
Action commands
| Built-in | Chapters |
|---|---|
do |
1, 2 (and throughout) |
force |
2 |
silently |
2 |
echo |
1, 2 (and throughout) |
emit |
2 |
ldesc |
2, 7 |
damage |
8 |
spell |
8 |
giveexp |
8 |
award |
8 |
oload |
7 |
mload |
7 |
opurge |
7 |
selfpurge |
7 |
trans |
7 |
stepto |
7 |
walkto |
7 |
driveto |
7 |
doorset |
7 |
doorexit |
7 |
mobflag |
7 |
tag |
6 |
untag |
6 |
Operators
| Operator | Chapters |
|---|---|
+ - * / % |
5 (also + in 6, 9) |
eq |
4, 6, 8 (and throughout) |
ne |
5 |
gt |
5, 9 |
lt |
4, 5 |
ge |
1, 5, 9 |
le |
5 |
not |
5, 6 |
and |
5 |
or |
5 |
(All operators are catalogued in Operators.)
Declarations, statements, and control flow
| Form | Chapters |
|---|---|
let |
5, 6, 9 (and throughout) |
set |
6, 9 |
const (local) |
6 |
const (top-level) |
9 |
def |
9 |
store |
6 |
recall |
6 |
forget |
6 |
if / elif / else |
1, 4, 5 |
return |
9 |
break |
9 |
continue |
9 |
require |
1, 3, 4, 8 |
unless |
3, 4, 8 |
halt |
1 |
pause |
9 |
nuke |
9 |
randomly |
2 |
Language features
| Feature | Chapters |
|---|---|
Comments (#) |
1, 9 (and throughout) |
| Integer literals | 5 |
Boolean literals (true / false) |
5 |
| Bareword string literals | 5 |
Single-quoted strings ('…') |
2 |
Double-quoted / interpolated strings ("…") |
2 (and throughout) |
Braced interpolation (${name}) |
2 |
Escapes (\n, \$, \[, …) |
2 |
List literal (( … )) |
3, 5 |
Blocks ({ … }) |
throughout |
Block parameters (<x>) |
3, 9 (and throughout) |
Multiple parameters (<a b>) |
9 |
Rest parameter (<…rest>) |
9 |
| Implicit block return (last statement) | 9 |
Variable reference ($name) |
throughout |
Command reference (&name) |
3, 4, 5, 9 |
Command substitution ([ … ]) |
throughout |
Expression statement ([expr]) |
9 |
Threading operator (/>) |
3, 6, 9 |
Handler phases (before / handle / after) |
1 |
| Events and filters | 1 (also 7, 8) |
Bound variables ($self, $actor, $arg, $args, $object, $spell, $killer) |
1 (also 2, 4, 7, 8) |
Guards (require / unless) |
1 |
| Suppression / interception | 1, 7 |
| Self-suppression | 1 |
| Lexical scope and shadowing | 6 |
| Two namespaces (command vs variable) | 6 |
| Hoisting of top-level declarations | 9 |
| The type set | 4 |
See also
- Reference — one page per built-in.
- Specification — the normative rules.
- Tutorial — a concept-by-concept introduction.