Help

TRIGGER

For immortals Also: TRIGGERS

Format: <trigger>

Most behaviors are 'activated' when they are 'triggered'. A 'trigger' defines what has to happen for a behavior to be activated. <trigger> consists of one of the following (use () to list multiple options).

[after] <EVENT>This is REQUIRED. See EVENT. The after option causes your behavior to be activated AFTER the event has occurred -- the default is before. For example, you usually want to trigger the 'say' event AFTER your target has said something -- not before they are about to. Not all events send an after event -- the ones that do have an asterisk (*) before them.
charmatch|cm <CHARMATCH>Charmatch criteria associated with this event. Note: charmatch is deprecated, use javascript instead.
objmatch|om <OBJMATCH>Objmatch criteria associated with this event. Note: objmatch is deprecated, use javascript instead.
javascript|js <JAVASCRIPT>A JavaScript expression that should evaluate to true to indicate success (false otherwise). The JavaScript must be surrounded by a matching pair of either single OR double quotes.
delay|del [actorwithself|aws][noactor|na] <delay amount> Indicates that the behavior behind this trigger should not take affect for <delay amount> of pulses. If the actorwithself option is specified the "actorwithself" restriction will be applied to the event. If the "noactor" option is specified then the actor will no longer be included. "aws" is just an abbreviation of "actorwithself" and "na" is an abbreviation of "noactor". For example: "delay aws 2d4+1" would delay the event by
2d4+1 pulses using theactorwithself restriction.

The following two are equivalent:

mb joe command (enterroom cm name tom) talk ^t Good to see ya, Tom!
mb joe command (enterroom js "actor=='Tom'") talk ^t Good to see ya, Tom!

Another example:

rb room javascript (say '/bell-tolls' del 1d4+2) msg( 'The bell tolls for you!' );