MongooseWhere programmers kick back and build silly things together.

All help topics · Link to this topic

Showing help on '@program#'

Syntax: @program <object>:<verb-name>
@program <object>:<verb-name> <dobj> <preposition> <iobj>
@program# <object>:<verb-number>

Changes the MOO program associated with the named verb on the named object.
If you provide <dobj> <preposition> and <iobj> as in the second form of this command, then it is the first verb with matching direct object, preposition and indirect object specifiers that is the one getting the new program. This is useful if you have several verbs matching the same name.

Or, you can use @program# if you know the verb's number. This is the 1-based index of the verb as it appears in the verbs() (or @verbs) output list.

Typing the @program command always puts the server into a line-reading mode, in which each line you type is saved away without any action unless said line is one of the following:

.
@abort
.<text>

A period on a line by itself ends the line-reading mode and continues with the command, in this case, the saved lines are considered as a program, checked for syntax errors and, if no errors are found, installed as the new program for the specified verb.

@abort causes the command to terminate immediately with no change to any verb's program. .<text> enters <text> literally as one of the lines to be saved, which is used for when, e.g., you want to enter the line `.' or the line `@abort'.

Note that this command *always* enters the line-reading mode, even if the indicated verb is not found. In this case, lines of text are still read but they are ignored. After any @program command, you always need to type a period or `@abort' to get back into the normal command-reading mode.