@verb

From TinyMUX
Jump to navigation Jump to search

@verb is a command that provides a way to do user-defined verbs with associated @attr/@oattr/@aattr groups.

Usage

Syntax: @verb victim=actor, what, def, owhat, odef, awhat, args

Invoking @verb does the following:

  • actor sees the contents of the what attribute on victim, or the def string if you can't read the victim's what attribute.
  • Everyone in the same room as actor sees the contents of the owhat attribute on victim, with the actor's name prepended, or odef, also with the actor's name prepended, if you can't read the victim's owhat attribute.
  • If you control victim, then he executes the contents of his awhat attribute.

You must control the actor, but need not control the victim. Note that if you don't have the ability to read the appropriate attributes (whether because you control the victim, he is VISUAL, or the attributes are set VISUAL), the default messages will be used.

Arguments

victim
The object that is searched for attributes, and which runs the <awhat> attribute if it is found.
actor
The object that 'did' the verb, this is the value for %#/%n/etc in substitutions, and this object's name is included in the message to others in the same location.
what
The name of the attribute containing the message to be delivered to the actor.
whatd
The message to deliver to the actor if the victim does not have a what attribute, or if it cannot be read.
owhat
The name of the attribute containing the message (prefixed by the actor's name) that is sent to everyone in the room with the actor.
owhatd
The message (prefixed by the actor's name) to deliver to others in the room with the actor if the victim does not have an owhat attribute, or it cannot be read.
awhat
The name of the attribute that is to be executed by the victim.
args
The comma-separated arguments to be passed to the stack for substitution (%0-%9). If there is more than one argument, enclose all the arguments within curly braces. Any argument that contains an embedded comma needs to be enclosed in curly braces as well.

Examples

> &xtest test1=You just xtested test1.
> &oxtest test1=just xtested test1.
> &axtest test1="I was xtested. Yikes. Arg1=%0, Arg2=%1, Arg3=%2.
> @verb test1=me,xtest,XTEST DFLT,oxtest,OXTEST DFLT,axtest,{a,b c,de}
You just xtested test1.
test1 says "I was xtested. Yikes. Arg1=a, Arg2=b c, Arg3=de."
> &xtest test1
> @verb test1=me,xtest,XTEST DFLT,oxtest,OXTEST DFLT,axtest,{a,b c,de}
XTEST DFLT
test1 says "I was xtested. Yikes. Arg1=a, Arg2=b c, Arg3=de."
> @fo test1={@verb test1=me,xtest,XTEST D,oxtest,OXTEST D,axtest,{a,b,de}}
test1 just xtested test1.
test1 says "I was xtested. Yikes. Arg1=a, Arg2=b, Arg3=de."

See also: locate().

Relevant help files: help @verb, help @verb2, help @verb3