LISTENING

From TinyMUX
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

LISTENING

Thee are two ways to listen for something in a room. The easiest way is to use a combination of @listen and @ahear/@aahear/@amhear. The second way is to use a "^" pattern in an attribute, similar to the way "$" is used for user-defined commands. The attribute takes the form: '^<pattern>:<action>'.

The ^-pattern check is only performed on objects with their MONITOR flag set. The criterion for triggering a pattern-listen is the same as that for triggering an @ahear - the object cannot trigger its own listen patterns. All matching attributes have their <action>s performed, not just the first. Also, attributes with the no_command flag set are not checked for ^-patterns, and neither are objects' parents.

Example:
> @va test = ^* says "foo *":say I got a foo with %1!.
Set.
> @set test=monitor
test grows ears and can now hear.
> say foo bar
You say "foo bar"
test says "I got a foo with bar!."

Related Topics: @ahear, @listen, @set.