C.97. $world->trigger


$world->trigger function: creates a TRIGGER

void $world->trigger( pattern ,
  action ,
  [attributes] );
void $world->trigger( number ,
  [pattern ,
  [action]] ,
  [attributes] );

Creates a new trigger, or edits the trigger identified by number, matching pattern (a Perl regular expression), that will execute action when a line is matched by pattern. action is interpreted as if it were typed in the command box. Simple strings get sent to the world, Perl code can be run by prefixing it with '/', etc.

atributes is a reference to a hash defining attributes for the trigger. Generally the call works like this:

$world->trigger("pattern", "action", { attribute1 => value1,
                                       attribute2 => value2, ... })

Possible attributes: