# @displayoptions mail regular-expressions ; @egrep @measure @remove-feature @add-feature errors options @rmproperty @args eval precedence @rmverb @check-chparent examine prepositions @setenv @check-property expressions prog-index @show @chmod features @prog-options statements @chparent @forked @progoptions tasks @clearproperty functions @program truth @copy @grep .program utilities @dbsize help @programmer-options utils @disinherit @kids @programmeroptions @verb @disown @kill programming @display language @property @display-options @list @prospectus
===== help # ====================================
#<string>[.<property>|.parent] [exit|player|inventory] [for <code>] returns information about the object (we'll call it <thing>) named by string. String is matched in the current room unless one of exit|player|inventory is given.If neither .<property>|.parent nor <code> is specified, just return <thing>.
If .<property> is named, return <thing>.<property>. .parent returns parent(<thing>).
If <code> is given, it is evaluated, with the value returned by the first part being substituted for %# in <code>.
For example, the command
#JoeFeedback.parent player for tonum(%#)will return 26026 (unless Joe has chparented since writing this).
===== help ; ============================= SEE eval
===== help @add-feature ===========================
Note to programmers: @add-feature and @remove-feature are front-ends for player:add_feature and :remove_feature.:add_feature returns
* E_PERM unless caller == this || $perm_utils:controls(caller_perms()) * E_INVARG if feature is not an object or is invalid * E_PERM if the object is not feature_ok * a true value otherwise and calls feature:feature_add, if the verb exists. :remove_feature returns * E_PERM unless caller this || $perm_utils:controls(caller_perms()) ||
caller_perms() == feature.owner * a true value otherwise and calls feature:feature_remove, if the verb exists.
===== help @args ================================
Syntax: @args <object>:<verb-name> <dobj>
@args <object>:<verb-name> <dobj> <prep>
@args <object>:<verb-name> <dobj> <prep> <iobj>
===== help @check-chparent ========================
Syntax: @check-property <object>.<propname>
@check-chparent <object> to <newparent>
Likewise you cannot chparent an object to a new parent if the new parent has a property that is also defined on the object or some descendant. Use @check-chparent to find out all instances of conflicting properties that would interfere with @chparent in this manner.
Note that @check-property requires either that you own the object or that it be writeable, the same conditions that need to hold if you are to create new properties on the object. Similarly, @check-chparent requires that you own the object and that the new parent is either fertile or likewise owned by you.
For objects with large numbers of descendants, these commands can be time-consuming.
===== help @check-property ======= SEE @check-chparent
===== help @chmod ==============================
Syntax: @chmod <object> <object-permissions>
@chmod <object>.<prop-name> <property-permissions>
@chmod <object>:<verb-name> <verb-permissions>
<object-permissions> r, w, f <property-permissions> r, w, c <verb-permissions> r, w, x, dSee the LambdaMOO Programmer's Manual for their meanings.
To clear all of the permissions for an object, verb, or property, use "" as the second argument.
@chmod also accepts +, !, and - as modifiers for a single permission to add or subtract that permission from the current set. (! and - are the same.)
Examples:
Set a verb to be Readable and Callable: @chmod chair:sit rx
Set a verb to be not Callable, without changing its other permissions: @chmod cookies:eat !x
Set an object to be Writeable in addition to any current bits: @chmod table +w
See @disinherit
===== help @chparent ============================
Syntax: @chparent <object> to <new parent>
===== help @clearproperty =========================
Syntax: @clearproperty <object>.<prop-name>
`@clearproperty' can be abbreviated as `@clearp'.
Example:
@create #1 named foo You now have foo with object number #42 and parent Root Class (#1). [foo, as a child of #1 has a .description property which starts out clear] ;#1.description => "" ;#1.description = "You see nothing special" => "You see nothing special" ;#42.description => "You see nothing special" ;#42.description = "Something special" => "Something special" [foo.description is now no longer clear; it has a value of its own] ;#1.description = "Boring" => "Boring" ;#42.description => "Something special" @clearp foo.description Property #42.description cleared; value is now "Boring". [foo.description is now clear again] ;#1.description = "" => "" ;#42.description => ""See @chparent
===== help @copy ================================
Syntax: @copy <object>:<verb> to [<newobject>][:<newverb>]
Examples: @copy me:verbname to myobject @copy me:test_verb to myobject:real_verbIn general, @copy'ing verbs is a bad idea. In the vast majority of cases, the desired effect can be accomplished with parenting (i.e., having <object> be an ancestor of <newobject>), which has the advantage that if a verb is updated or fixed, this immediately becomes available to child objects that inherit this verb. In such a case, copies that were made using @copy have to be tracked down and fixed by hand. This facility is provided for those rare occasions where one has no choice but to actually copy the verb.
===== help @dbsize ===============================
Syntax: @dbsize
===== help @disinherit =============================
Syntax: @disinherit <object>
@disinherit <object> [from <parent>]
Synonym: @disown
Both forms of this command chparent <object> to its grandparent, provided you own the parent. The second form matches the string you supply for <object> against the list of children of the given <parent>.
Turning off the fertile bit (.f) for a particular object prevents others from creating children of it or chparenting to it (see `help @chmod').
Note also that, though the name might seem to indicate otherwise, this command does not change the ownership of any object.
===== help @disown ================== SEE @disinherit
===== help @display ==============================
Syntax: @display <object>.[property]
,[inherited_property]
:[verb]
;[inherited_verb]
You may mix properties and verbs on the command line, but the parser may become confused. (E.g. @display object,: displays all properties including inherited ones plus all locally defined verbs on the object.)
Examples: Individual property: @display poolsweep.count .count yduJ (#68) r c 8 Individual verb: @display poolsweep:tell #3560:tell yduJ (#68) rxd this none this All properties, including one truncated value: @display poolsweep. poolsweep (#3560) [ readable ] Owned by yduJ (#68). Child of generic thing (#5). Location The Pool (#1428). .gagged yduJ (#68) r c 0 .count yduJ (#68) r c 8 .messages yduJ (#68) r c {"The poolsweep stir.. .index yduJ (#68) r c 2 .quantum yduJ (#68) r c 20 Inherited verbs, edited for brevity, showing verbs from various parents, with owners,Some aspects of @display can be customized (see `help @display-options'.
permissions, and argument lists. @d poolsweep; poolsweep (#3560) [ readable ] #3560:tell yduJ (#68) rxd this none this #3560:description yduJ (#68) rxd this none this #5:"g*et t*ake" Haakon (#2) rxd this none none #5:"d*rop th*row" Haakon (#2) rxd this none none #5:moveto Haakon (#2) rxd this none this #1:description Haakon (#2) rxd this none this #1:look_self Haakon (#2) rxd this none this
===== help @display-options ========================
Syntax: @display-option
@display-option <option>
Synonym: @displayoption
@display-option +<flag> @display-option -<flag> @display-option !<flag> (equivalent to -<flag>)These respectively set and reset the specified flag
-blank_tnt Show the verb args on all verbs. +blank_tnt Don't show the verb args on `this none this' verbs. -shortprep Use full prepositions (e.g., "on top of/on/onto/upon") +shortprep Use short prepositions (e.g., "on") -thisonly Specifying . (:) to retrieve all properties (verbs) will go up the ancestor
chain until it finds a readable object with properties (verbs) defined on it. +thisonly Specifying . (:) to retrieve all properties (verbs) will only
display properties (verbs) defined on the object itself.
===== help @displayoptions ======== SEE @display-options
E===== help @egrep====================== SEE @grep
===== help errors ================================
*errors*
===== help eval ==================================
Syntax: eval <MOO-code>
; <MOO-code>
eval-d <MOO-code>
For programmers, this is such a mind-bogglingly useful thing to do that there is a simple abbreviation for this command; any command beginning with a semicolon (';') is treated as a use of 'eval'.
Eval treats specially a duplicated semicolon at the beginning. It enables you to make multi-statement programs within eval (but does not by default print the return value).
Eval-d (no ";" abbreviation for this) evaluates the following text exactly as eval, except that the "d" debug flag (see programmer's manual for explanation) is turned off. Thus errors will cause an error return value rather than a traceback.
If you set the player property .eval_time to 1, then eval will print out how many ticks and seconds the program required.
Examples: eval 3 + 4 => 7 ;3+4 => 7 ;for x in (player.aliases) player:tell(x); endfor Haakon Wizard ArchWizard => 0 ;;l = {}; for i in [1..10] l = {@l, i}; endfor return l => {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} eval-d 8 + "foo" => E_TYPE (Type mismatch)You may customize your evaluation environment. The player property .eval_env may contain statements to be executed prior to any evaluated program. Two caveats: This will throw off the tick count. You can account for additional ticks inserted by your environment with the .eval_ticks property; just set it to the number of ticks you'd like subtracted from the total. Additionally, if you make a syntax error in your program, the line reported will be wrong (it will count those initial statements), and if you make an error in the eval_env itself, you can be in deep trouble. Despite these drawbacks, the eval_env property can be quite useful. The following is a sample:
Eval_env: "me=player;here=player.location;" eval_ticks: 3SEE also @setenv. You can also define textual substitutions in a separate property, called eval_subs. These are discouraged, however, for anything that can be done with variable assignments, because the overhead of replacing the strings in the evaluated program is significant. However, some things, such as substituting characters which can't be typed easily on one keyboard (e.g. "[]" is difficult to type on some IBM keyboards), can only be done by textual substitutions. Note that the eval substitutions are also interpreted by the verb editor when "eval_subs" is selected in your .edit_options property (see `help editors'). This adds to their overhead, but again, makes it possible for people to program who otherwise can't type the full character set. Remember: Don't use eval_subs unless you really have to!
===== help examine ==============================
[Note to programmers: the 'obvious' verbs are those that can be invoked as commands and are not specified by the :hidden_verbs verb. The default definition of "hidden" is "not readable". You can override this definition with a :hidden_verbs verb that gets the default list with pass(@args) and then alters that list.]===== help expressions ============================
The following kinds of expressions exist in the MOO programming language:number # number # - number "character string" error-nameLiteral expressions return the obvious values: numbers, object numbers, strings, and errors.
{ expression , expression , ... , expression }The list-construction expression evaluates the each of the expressions in turn and returns a list whose elements are the results of those expressions. Any of the expressions may be prefixed with an at-sign ('@'); in this case, that expression must return a list and, rather than that list becoming an element of the final list, its elements are spliced into the final list.
nameVariable expressions return the current value of the named variable. Variable names must start with a letter or underscore ('_') and contain only letters, digits, and underscores. The following variables are predefined:
OBJ, STR, LIST, ERR, NUM player, caller, this, verb, args argstr, dobj, dobjstr, prepstr, iobj, iobjstrTheir initial values are described in detail in the LambdaMOO Programmer's Manual.
expression . name expression . ( expression ) $ nameProperty-reading expressions return the current value of a named property on the object that is the value of the first subexpression. In the second form, the second subexpression must return a string, the name of the property to be read. The third form is an abbreviation for '#0.name'.
expression : name ( arguments ) expression : ( expression ) ( arguments )Verb-call expressions invoke a named verb on the object that is the value of the first subexpression, passing the given arguments. In the second form, the second subexpression must return a string, the name of the verb to invoke. The syntax and semantics of arguments is exactly as in the list-construction expression but no initial or final curly-braces ('{' or '}') are used.
function ( arguments )The function-call expression invokes one of the MOO primitive functions, as listed in 'help functions', passing the given arguments.
expression [ expression ]The indexing expression first evaluates the two subexpressions; call their values S and N, respectively. S must be a string or a list and N must be a number between 1 and the length of S, inclusive. The Nth element of S is returned. The elements of a string are themselves one-character strings.
expression [ expression .. expression ]The subsequence expression first evaluates the three subexpressions; call their values S, N1, and N2, respecitively. S must be a string or a list and N1 and N2 must be numbers. If N1 <= N2, then both must be between 1 and the length of S, inclusive; the subsequence of S beginning at index N1 and continuing through index N2 is returned. If N1 > N2, the empty sequence of the same type as S is returned, either "" or {}.
name = expression expression . name = expression expression . ( expression ) = expression $ name = expressionAssignment expressions give new values to variables and object properties. For the second and third forms, the expressions on the left-hand side of the '=' are evaluated first. Then the right-hand side expression is evaluated and result is stored in the indicated variable or object property.
expression + expression expression - expression expression * expression expression / expression expression % expression - expressionThe arithmetic expressions evaluate the subexpressions, all of which must return numbers, and then perform addition, subtraction, multiplication, division, remaindering, or negation, respectively. For addition, the subexpressions may both return strings as well; in this case, the result is the concatenation of the two strings.
expression == expression expression != expression expression expression expression <= expression expression > expression expression >= expressionThe comparison expressions evaluate the subexpressions and then test whether or not the first result is equal to, unequal to, less than, less than or equal to, greater than, or greater than or equal to the second result, respectively. If the indicated relation holds then they return 1 and otherwise they return 0. Comparisons of strings are performed case-insensitively, those of lists are performed on an element-by-element basis, objects are compared by their object numbers, and errors by an ordering given in the LambdaMOO Programmer's Manual.
expression ? expression | expression expression && expression expression || expression ! expressionThe logical expressions each return results based upon the truth value of their first subexpression; call the value of this expression X. The first of these returns the value of the second subexpression if X is a true value and that of the third expression if X is a false value; the unused subexpression is not evaluated. The definitions of 'true value' and 'false value' are given in 'help truth'. The expression 'E1 && E2' is an abbreviation for 'E1 ? E2 | E1' except that E1 is only evaluated once. The expression 'E1 || E2' is an abbreviation for 'E1 ? E1 | E2' except that E1 is only evaluated once. The expression '! E' is an abbreviation for 'E ? 0 | 1'.
expression IN expressionThe list-membership expression first evaluates both subexpressions; call their values E and L, respectively. L must be a list. If E is an element of L, then the index of the first occurence of E in L is returned. If E is not an element of L, then 0 is returned.
The method for disambiguating the meaning of a complex MOO expression in the absence of sufficient parentheses is described in 'help precedence'.
===== help features ==============================
Note to programmers: In order to be available for general use as a feature, an object must have a verb or property named "feature_ok" which returns a true value.When a feature is added to a player's features list, feature:feature_add is called, if it exists, with the player in question as its argument. Likewise, when a feature is removed, feature:feature_remove is called.
===== help @forked ==============================
Syntax: @forked
Queue ID: A numeric identifier for the task, for use in killing it (see 'help @kill'). Start Time: The time after which the task will begin execution. Owner: The player whose permissions under which the task is running. Unless you are a wizard, @forked will show only your tasks. Verb: The object and verb-name of the code that forked the task. Line:The line number of the first statement that the task will execute when it starts. Note that the code for the verb in question may have changed since the task was forked; the forked task will use the version that was being executed when it was forked.
This:
The value of `this' for the forked task, in the case that it is different from (i.e., is a descendant of) the object on which the verb code lives.
===== help functions ==============================
There are many, many built-in functions available to MOO programmers [language]. The following list gives a brief summary of the arguments and purpose of each function; for more information, see the LambdaMOO Programmer's Manual.pass(arg, ...) | -- calling a verb defined on this object's parent |
eval(string) | -- parsing and executing strings as MOO code |
notify(player, string) | -- sending text to a player's terminal |
read() | -- reading a line of input from the player (*) |
output_delimiters(player) | -- return {prefix,suffix} set by PREFIX/SUFFIX cmds |
typeof(value) | -- determining the data type of a value |
tostr(value, ...) | -- converting any set of values into a string |
tonum(value) | -- converting any non-list value into a number |
toobj(value) | -- converting any non-list value into an object |
length(value) | -- returns the length of a string or list |
listappend(list, value [, index]) | -- adding an element at the end of a list |
listinsert(list, value [, index]) | -- adding an element at the head of a list |
listset(list, value, index) | -- updating a list at some index |
listdelete(list, index) | -- removing an element from a list |
setadd(list, element) | -- adding an element to a set represented as a list |
setremove(list, element) | -- removing an element from such a set |
min(n1, n2, ...) | -- minimum of n1,n2,... |
max(n1, n2, ...) | -- maximum of n1,n2,... |
abs(n) | -- absolute value of n |
sqrt(n) | -- square root of n, rounded down |
random(n) | -- random integer between 1 and n inclusive |
time() | -- current time in seconds since midnight GMT, 1 Jan 70 |
ctime([time]) | -- time (or current time) converted to a human-readable string |
index(str1, str2 [, case-matters]) | -- index of first str2 in str1 |
rindex(str1, str2 [, case-matters]) | -- index of last str2 in str1 |
strcmp(str1, str2) | -- case-sensitive string comparison |
strsub(subject, what, with [, case-matters]) | -- substitution in a string |
crypt(string [, salt]) | -- one-way string encryption |
match(str1, str2 [, case-matters]) | -- match first pattern str2 in str1 |
rmatch(str1, str2 [, case-matters]) | -- match last pattern str2 in str1 |
substitute(template, subs) | -- perform substitutions on template |
valid(object) | -- testing whether an object exists |
create(parent [, owner(*)]) | -- creating a new MOO object |
recycle(object) | -- destroying a MOO object |
move(object, where) | -- altering the object-containment hierarchy |
chparent(object, new-parent) | -- altering the object-inheritance hierarchy |
parent(object) | -- object's parent in the inheritance hierarchy |
children(object) | -- object's children in the inheritance hierarchy |
max_object() | -- the highest-numbered object in the MOO |
renumber(obj) | -- changes an object's number to lowest available one (*) |
reset_max_object() | -- resets max_object() to the largest valid object (*) |
properties(object) | -- a list of the properties defined on an object |
add_property(object, prop-name, value, info) | -- add a new property |
delete_property(object, prop-name) | -- remove a property |
property_info(object, prop-name) | -- {owner, perms} info on a property |
set_property_info(object, prop-name, info) | -- setting same |
is_clear_property(object, prop-name) | -- find out if a property is "clear" |
clear_property(object, prop-name) | -- make a property "clear" |
verbs(object) | -- a list of the verbs defined on an object |
add_verb(object, info, args) | -- add a verb to an object |
delete_verb(object, verb-name) | -- remove a verb from an object |
verb_info(object, verb-name) | -- {owner, perms, names} info for a verb defn. |
verb_args(object, verb-name) | -- {dobj, prep, iobj} argument info for a verb |
verb_code(object, verb-name [, fully-paren [, indent]]) | -- program listing |
set_verb_info(object, verb-name, {owner, perms, names}) | |
set_verb_args(object, verb-name, {dobj, prep, iobj}) | |
set_verb_code(object, verb-name, {line, line, ...}) | |
is_player(object) | -- testing whether or not object is a player |
players() | -- a list of all players, active or not |
connected_players() | -- a list of all currently-connected players |
idle_seconds(player) | -- seconds since given player typed anything |
connected_seconds(player) | -- seconds given player has been logged in |
boot_player(player) | -- disconnect player from the MOO immediately(*) |
set_player_flag(player, value) | -- set/clear player bit; boot player if clear(*) |
connection_name(player) | -- a server-assigned name for player's connection |
open_network_connection(@args) | -- open a connection to another network site |
caller_perms() | -- the player whose permissions your caller was using |
set_task_perms(player) | -- changing permissions of the running task (*) |
callers() | -- list of {obj, verb, owner, vloc, player}: this task's stack |
suspend(secs) | -- suspending the current task for a number of seconds |
seconds_left() | -- number of seconds left in the current task |
ticks_left() | -- number of ticks left in the current task |
task_id() | -- a random number representing the currently-running task |
queued_tasks() | -- list of {id,start,0,20000,owner,obj,verb,line,this} |
kill_task(id) | -- delete one of your tasks from the queue |
server_log(string) | -- add a comment to the server log file |
server_version() | -- a string of three numbers "major.minor.release" |
memory_usage() | -- {{blocksize, nused, nfree}, ...}, the server's memory stats |
shutdown(msg) | -- print msg and kill the server (*) |
dump_database() | -- what it says (*) |
===== help @grep ===============================
Syntax: @grep <string> in <object>
@grep <string> in {<objectlist>}
@egrep <regexp> in <object>
@egrep <regexp> in {<objectlist>}
These are named for the corresponding unix utilities.
@grep searches the given object(s) for verbs whose verbcode contains the given string as a substring of one of its lines.
@egrep searches the given object(s) for verbs whose verbcode contains a substring matching the given regular expression (see `help regular-expressions').
===== help help ==================================
For programmers, the help system provides the following additional forms:help object:verbname -- prints any documentation strings that are present at the beginning of the program for that verb. help $<whatever>_utils -- prints general information about one of the $..._utils objects (e.g., $string_utils, $list_utils, etc...), which are all libraries of generally used verbs. help builtin() -- prints documentation from the programmers manual about the named primitive, for example length()For information about how the help system itself works and about how to associate local help databases with specific rooms or player classes, see `help $help'.
===== help @kids ================================
Syntax: @kids object
Example: @kids #3107 Generic Body of Chlorinated Water(#3107) has 3 kids. The Pool(#1428) The Hot Tub(#388) Deep Blue Underground Pool(#17340)
===== help @kill =================================
Syntax: @kill task_id
@kill [object]:[verb]
@kill soon [number-of-seconds]
@kill all
@kill %trailing_id
@kill task_id kills only the task with that id.
@kill object:verb kills all tasks which were scheduled by the object running the verb named. Both object and verb are optional: @kill object: kills all tasks scheduled by that object, and @kill :verb kills all tasks which were scheduled by any object running that verb. This can be useful if you have several similar objects which are running tasks from similarly named verbs. (Perversely, @kill : kills all tasks... Any object running any task.)
@kill soon kills all tasks scheduled within the next minute. @kill soon number kills all tasks scheduled within that number of seconds, e.g. @kill soon 300 would kill all tasks scheduled within the next five minutes. This can be useful if you have a runaway task you want to quickly remove, but don't want to kill you later tasks.
@kill all kills all tasks. Like @kill soon, but more dramatic.
@kill %trailing_id expects you to specify the last few digits of a task id. It then kills all tasks that end with those digits.
Example: @forked 1359083655 Sep 16 21:45:00 1991 yduJ #5803:heartbeat (10) [#68] @kill %655 Killed: task 1359083655, verb #5803:heartbeat, line 10, this==#68L
===== help language ==============================
The MOO programming language is described in excruciating detail in the LambdaMOO Programmer's Manual, available for FTP from parcftp.xerox.com in the file pub/MOO/ProgrammersManual.txt. The online help consists of a few quick reference guides here in the help system under the following topics:statements -- the syntax and semantics of the various kinds of MOO statements expressions -- the same for the various kinds of MOO expressions functions -- a list of the primitive functions available to MOO programs
===== help @list ================================
Syntax: @list <object>:<verb>
@list <object>:<verb> [with|without parentheses|numbers]
@list <object>:<verb> <dobj> <prep> <iobj>
Normally, the code is shown with each line numbered and with only those parentheses that are necessary to show the meaning of the program. You can e.g., specify `without numbers' to have the numbers omitted or `with parentheses' to include all parentheses or even `with parentheses without numbers' to do both.
The 3rd form of the verb lists the verb matching the given dobj/prep/iobj specification if such exists.
Example: Type `@list $room:@move' to see the code for the `@move' command, or evenThe 2nd and 3rd forms can be combined, e.g.,
`@list $prog:@list' to see the code implementing @list itself...
@list frobule:burfle this in front of any without numberswhich would be useful if `frobule' had more than one `burfle' verb and we wanted to see the one having `this' `in front of' `any' as its respective dobj/prep/iobj specifiers.