Tempus Script Reference
A look-up reference for the Tempus scripting language. Each built-in has its own page describing what it does, what it takes, what it returns, and how it behaves, with worked examples and links to related built-ins and concepts.
This manual is task-oriented: it answers "what does this do and how do I use it?" For the precise, normative definition of the language — grammar, the exact rules that make a script correct or incorrect — see the language specification. Where the two differ in emphasis, the specification is authoritative on correctness; this reference is the place to look things up.
How to read a built-in page
Each page opens with a signature line, for example:
oload <vnum> [target] [max]
The notation is:
<x>— a required argument.[x]— an optional argument.x…— the argument may be repeated one or more times.
Argument and result types (int, string, bool, creature, object, room, iterable, block, and so on) are described in Types.
Concepts
Start here for the shape of the language. Built-in pages link back to these.
- Types — the kinds of values: scalars, entity references, iterables, blocks, lists.
- Values and equality — truthiness, equality, automatic conversion to text.
- Variables —
let,set,const, and$namelookup. - Scope and declarations —
defandconstat the top level, lexical scope. - Blocks — block bodies, parameters, and the value a block produces.
- Iterables — lazy sequences, what counts as an iterable, and why a bare string is not one.
- Strings and interpolation — the two string forms and building text with
$nameinterpolation. - Operators — arithmetic (
+ - * / %), comparison (eq ne gt lt ge le), and logic (and or not). - Control flow —
if,return,break,continue,halt,pause,nuke. - Persistent state —
storeandrecall. - Handlers, events, and phases — how a script reacts to game events, the
before/handle/afterphases, bound variables like$selfand$actor, and therequire/unlessguards.
Built-in functions
Predicates (yield a bool)
abbrev ·
cansee ·
exists ·
hastag ·
isabbrev ·
isfighting ·
isholding ·
ismob ·
isnull ·
isobj ·
isplayer ·
iswearing ·
keyword ·
location ·
random ·
streqi
Entity queries and accessors
alignment ·
carrier ·
class ·
gen ·
he ·
him ·
his ·
hour ·
level ·
moonphase ·
name ·
position ·
room ·
vnum
Collection producers (yield an iterable)
alias ·
contents ·
creatures ·
equipment ·
fighting ·
implants ·
inventory ·
list ·
objects ·
people ·
tattoos ·
words
Iterable consumers
choose ·
count ·
each ·
empty ·
every ·
first ·
hasabbrev ·
ismember ·
nth ·
select ·
slice ·
some
Math, string, and conversion
int ·
lower ·
randrange ·
substr ·
upper
(The arithmetic, comparison, and logical operators are documented together in Operators.)
Prototype retrieval
Action commands (act for their effect, yield null)
award ·
damage ·
do ·
doorexit ·
doorset ·
driveto ·
echo ·
emit ·
force ·
giveexp ·
ldesc ·
mload ·
mobflag ·
oload ·
opurge ·
selfpurge ·
silently ·
spell ·
stepto ·
tag ·
trans ·
untag ·
walkto