The MUF Cheat-Sheet, as seen by Sammael (Arthur, The., etc)
-or-
Reference manual for MUCK Forth ("MUF") -terse
-modified for MAGE-
v1.1.1 October 31, 1992
ENTERING EDITING MODE
@prog <program name> (creates a new program if none match)
@edit <program name or number>
EDITING COMMANDS
<number> i insert before <number>
. exit insert mode
c compile
<number1> <number2> l list
<number1> <number2> d delete
<letter> <letter> a show macros (abridged)
<letter> <letter> s show macros (long)
<program#> v view program header
h help on edit mode
u uncompile
q quit editor mode
PRIMITIVE TERMINOLOGY
v type variable
d type dbref
i type int (boolean)
s type string
a type address (word)
c type connection
SYNTAX
( ... ) commments
: begin user-def word
; end user-def word
var <VARNAME> variable declaration
if ( i -- )
else ( -- )
then ( -- )
exit ( -- )
execute ( a -- ??? )
pop ( x -- )
dup ( x -- x x )
swap ( x y -- y x )
over ( x y -- x y x )
rot ( x y z -- y z x )
rotate ( ni ... n1 i -- n(i-1) ... n1 ni )
pick ( ni ... n1 i -- n1 ni )
put ( ni ... n1 x i -- x ... n1 )
! ( x v -- ) store value x in var v.
value may be any type data
@ ( v -- x ) fetch value x from var v
atoi ( s -- i ) string --> integer
intostr ( x -- s ) integer || dbref --> string
dbref ( x -- d ) string || integer --> dbref
int ( x -- i ) string || VAR || object
--> integer
variable ( i -- v ) integer --> VAR ref
prog ( -- d ) current program
dbtop ( -- d ) top of database
+ - * / % ( i1 i2 -- i )
< > = <= >= ( i1 i2 -- i )
strcmp,
stringcmp ( s1 s2 -- i ) strcmp == case sens.
strncmp, stringncmp
( s1 s2 n -- i ) compares only n letters
number? ( s -- i )
dbcmp ( d1 d2 -- i )
and or ( i1 i2 -- i )
not ( i -- i' )
strlen ( s -- i )
strcat ( s1 s2 -- s )
instr ( s1 s2 -- i ) finds string s2 within s1
strcut ( s i -- s1 s2 ) cuts string at pos. i
explode ( s1 s2 -- ... i ) s2 is the partition, len >0
subst ( s1 s2 s3 -- s ) string, replacement, tobesub
pronoun_sub ( d s -- s' ) does % subs ala osucc/ofail
pronoun_eval ( d s d -- s' ) does % subs ala MUSH
read ( -- s )
notify ( d s -- ) object, message
notify_except ( d1 d2 s -- ) place, exception, message
pennies ( d -- i )
addpennies ( d i -- ) player, pennies
random ( -- i )
getpropval ( d s -- i ) zero if none
getpropstr ( d s -- s ) "" if none
setprop ( d s1 x -- ) x is string or integer
remove_prop ( d s -- )
name ( d -- s ) retrieve name
setname ( d s -- ) set name
player?, thing?,
room?, program?,
exit?, ok? ( d -- i ) boolean
location ( d -- d' )
owner ( d -- d' )
moveto ( d1 d2 -- ) moves d1 to d2
set ( d s -- ) object, string (flag)
flag? ( d s -- i ) object, string, boolean
call ( d -- ??? ) call remote program
match ( s -- d ) thing, dbref (#-1 = NOTHING,
#-2 = AMBIGUOUS, #-3 = HOME)
rmatch ( d s -- d ) object, thing, dbref
copyobj ( d -- d' ) returns dbref of new object
contents ( d -- ... i ) returns stack of dbrefs and i
trigobj ( d s -- ) trigger object to perform
a set of commands
systime ( -- t ) seconds since January 1, 1990
strftime ( t s -- s1) format systime
online ( -- d d ... i) list and number of users
awake? ( d -- i ) # of times player is connected
wild_match ( s1 s2 -- i) s1 can contain a wildcard('*')
connections ( -- c c ... i )
returns list of/number of connections
concount ( -- i ) returns number of connections
conidle ( c -- i ) idle time, in seconds
contime ( c -- i ) when connected
condbref ( c -- d ) player corresponding to connection
conhost ( c -- s ) host name (wiz-only)
conboot ( c -- ) boots player (wiz-only)