external next up previous contents index
Next: 10.5 Variables and Values Up: 10.4 Verbs and command Previous: Command parsing

Verb argument specification

 

Before you program a verb you must create it (i.e. add it to and object), specify its arguments and define its permission. Typing help @verb will give you all the information that is below. In order to create a verb you nee the @verb command. It's general syntax is:

Syntax:  @verb <object>:<verb-name(s)>
         @verb <object>:<verb-name(s)> <dobj> [<prep> [<iobj>]]

@verb adds a new verb with the given name(s) to the named object. If there are multiple names, they should be separated by spaces and all enclosed in quotes:

        @verb foo:"bar baz mum*ble"

The direct and indirect object specifiers (<dobj> and <iobj>) must be either 'none', 'this', or 'any'; their meaning is discussed in the LabmdaMOO Programmer's Manuel (sections 2.2.3 and 3).

The preposition specifier (<prep>) must be either 'none', 'any', or one of the following prepositional phrases:

    with/using
    at/to
    in front of
    in/inside/into
    on top of/on/onto/upon
    out of/from inside/from
    over
    through
    under/underneath/beneath
    behind
    beside
    for/about
    is
    as
    off/off of
A prepositional phrase with more than one word must be enclosed in quotes ("")). All three specifiers default to 'none'.

With the @verb command, it is also possible to specify the new verb's permissions and owner as part of the same command (rather than having to issue separate @chmod/@chown commands)

     @verb <object>:<verb-name(s)> <dobj> <prep> <iobj> <permissions>
     @verb <object>:<verb-name(s)> <dobj> <prep> <iobj> <permissions> <owner>

<permissions> are as with @chmod, i.e., must be some subset of "rwxd". They default to "rd" (specifying "w" for a verb is highly inadvisable, see section 10.7 for details). The owner defaults to the player typing the command; only wizards can create verbs with owners other than themselves.

You may also use "tnt" in place of "this none this" for the dobj prep iobj arguments. "this none this" is used to indicate non-command verbs, since the parser can't possibly interpret a command as "this none this". For these verbs, the permissions default to "rxd"; the "x" bit is set so that they can be called from other programs. (If they couldn't be used as commands, and they couldn't be called from programs, they wouldn't be good for anything!)

Changing verb arguments:

Sometimes you need to change an argument specification, either because you misused the @verb command or because you figure that you need it differently. Use the @args command:

Syntax:  @args <object>:<verb-name> <dobj>
         @args <object>:<verb-name> <dobj> <prep>
         @args <object>:<verb-name> <dobj> <prep> <iobj>

Changes the direct object, preposition, and/or indirect object specifiers for the named verb on the named object. Any specifiers not provided on the command line are not changed. The direct and indirect object specifiers (<dobj> and <iobj>) must be either 'none', 'this', or 'any' (see above). The preposition specifier (<prep>) must be either 'none', 'any', or one of the prepositional phrases listed in `help prepositions'.

Here is a transcript that shows an example on how you look at a verbs arguments and how you change that.

>@d me:grab
  6 #1324:grab                  MooBoy (#1324)       r d    any at/to any
-------------------------------- finished ---------------------------------
>@args me:grab any none none
Verb arguments changed.
>@d me:grab
  6 #1324:grab                  MooBoy (#1324)       r d    any none none
-------------------------------- finished ---------------------------------

Removing verbs

Syntax:  @rmverb <object>:<verb-name>
         @rmverb <object>:<verb-name>  <dobj> <prep> <iobj>

Removes the named verb from the named object. If there is more than one verb matching the given verb-name, this removes the most recently defined one.

With the 2nd form of the command the verb removed is the most recent one matching both the given verb-name *and* the given dobj/prep/iobj specifiers. Use this for instance to remove uselss verbs with wrong arguments specifiers (a frequent beginner's mistake). Here is an example:

>@d #4122:
holder (#4122) [ readable ]
 Owned by Bernard (#4326).
 Child of generic thing (#5).
 Location Bernard (#4326).
 1 #4122:add     Bernard (#4326)      r d    any at/to this
 2 #4122:dump    Bernard (#4326)      r d    this none none
 3 #4122:show    Bernard (#4326)      r d    any on top of/on/onto/upon this
 4 #4122:clear   Bernard (#4326)      r d    none none none
 5 #4122:clear   Bernard (#4326)      r d    this none none
 6 #4122:erase   Bernard (#4326)      r d    any out of/from inside/from this
-------------------------------- finished ---------------------------------

>@rmverb #4122:clear none none none
Verb removed  #4122:"clear"  none none none  rd  (4)


next up previous contents index external
Next: 10.5 Variables and Values Up: 10.4 Verbs and command Previous: Command parsing

Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997