cf::mapscript
This module implements the mapscript object.
Map scripts are perl snippets that get executed whenever any connected element is triggered (e.g. a check inv, a lever etc.)
The map scripts are compiled and executed into a namespace with the following symbols available:
The mapscript object itself.
The state value (0 means release, <>0 means push/trigger/enable) that triggered the map script.
The object that was triggered (the lever, check inv element, npc etc.).
The object that triggered the activator, usually (but not always) the
player who stepped on a check inv, pulled a lever etc. Can be undef.
Finds all objects with the given connected $id. If an object
reference is passed, it will be returned unchanged.
Triggers the linked chain with the given connected id, or the connected
chain associated with the given object (if an object reference is passed),
and passes the given state (or 1, if missing) to it.
Starts the timer on the given mapscript object (usually, $id_or_object is
$self). When the timer expires on the mapscript object, it will trigger
the script with $activator == $self and $originator == undef.
Have a look at scorn/anthonty/portgate.map for a nontrivial example.