Monday, October 26, 2015

Mesmerizer Command Reference, Events and Variables

An event is a trigger-phrase, generated internally by the Mesmerizer, usually in response to some external event, that will cause corresponding trigger-rules to fire. The following events are defined:
  • on-rlv-enabled - fires when RLV is detected
  • on-rlv-disabled - fires when RLV is not detected
  • on-enter-trance - fires when the sub is placed into a trance
  • on-leave-trance - fires when the sub leaves a trance
  • on-stand - fires when the sub stands from sitting on something
  • on-sit - fires when the sub sits on something
  • on-init - fires on login or when the Mesmerizer is reset
  • on-detach - fires when the Mesmerizer is detached
  • on-attach - fires when the Mesmerizer is attached
  • on-teleport - fires when the sub completes a teleport
  • on-region - fires when the sub changes regions
  • on-report - fires every few minutes after report data has been collected
  • on-mode - fires when the animation mode changes
  • on-pan - fires when a PAN message is received
  • on-commlink-message -  fires when a Mesmerizer chat message is received.
  • on-arousal - fires when the subject's arousal changes (when using Xcite! or other compatible genitals)
  • on-orgasm - fires when the subject's Xcite! or compatible genitals report an orgasm
  • on-chat - fires when the sub says something in local chat (as of version 0.98b)
  • on-emote - fires when the sub emotes something in local chat (as of version 0.98b)
You can define a trigger-rule to respond to one of these events simply by using the event-name as the trigger-phrase.   So a rule definition such as:

on-orgasm = internal shout "I'm cumming!!!"

would make the sub shout that every time their Xcite! genitals reported an orgasm.

You should avoid defining your own trigger-phrases beginning with "on-", to eliminate the possibility of collision with a future Mesmerizer-defined event.

Events are not passed parameters, but they can make use of variables to determine precisely why they were invoked.  For example, consider the following trigger-rule:

on-region = internal text "Entered $sim"

The effect of this rule is that, whenever the sub enters a new region, the name of the sim will be briefly displayed at the center of their screen.  $sim is an example of a variable expansion.  The Mesmerizer maintains a number of pre-defined variables, and you may define your own variables with the setvar and setvarex commands.  In the example above, sim is the name of a pre-defined variable, and $sim corresponds to the value of that variable - the name of the current sim.

Here is a list of the current pre-defined variables:
  • date - a UTC date in the form YYYY-MM-DD
  • datetime - a UTC timestamp in the format "YYYY-MM-DDThh:mm:ss.ff..fZ"
  • sim - The name of the current sim
  • parcel - The name of the current parcel
  • username - The sub's username (e.g. "susan.calvin" or "fred")
  • legacyname - The sub's legacy name (e.g. "Susan Calvin" or "Fred Resident")
  • firstname - The first word in the sub's legacy name (e.g. "Susan" or "Fred")
  • event - the name of the current event, or "none" if no event is firing.
  • rlvrestricted - a comma-separated list of RLV restrictions that are currently applied.
  • rlvpermitted - a comma-separated list of RLV restrictions that are _not_ applied
  • rlvsavedrestricted - the last saved rlvrestricted value
  • rlvsavedpermitted - the last saved rlvpermitted value 
  • rlvattachlockadd - comma-separated list of attachment points locked for add
  • rlvattachlockrem - comma-separated list of attachment points locked for remove
  • rlvclotheslockadd - comma-separated list of clothing layers locked for add
  • rlvclotheslockrem - comma-separated list of clothing layers locked for remove
  • rlvsendchannels - Either "all" or a comma-separated list of permitted channels
  • sitting - Key of object the sub last sat on and didn't stand up from
  • hypnotist - name of current hypnotist, or "none" if not in trance
  • arousal - the most recent arousal level (0..100) reported by compatible genitals.
  • ReportNearbyList - "ReportXXX" variables will be described in another post.
  • ReportNearby
  • ReportLocation 
  • ReportParcel
  • ReportFacing
  • ReportSittingOn
  • ReportParcelFlags
  • message - the most recent message the sub said or emoted in chat (as of 0.98b)

While there is nothing to prevent you using the the setvar and setvarex commands to change the value of a predefined variable, such changes will be overwritten by the Mesmerizer on an unpredictable schedule, so there is little point in doing so, and any rules that do so are relying on behavior that may change in a future version of the Mesmerizer.  You should treat all predefined variables as if they were read-only.

This table lists the commands relating to variables:
Command Params Description
setvar 2 Set the value of variable <p1> to <p2>
setvarex 2 Set the value of variable <p1> to the value given by evaluating the expression <p2>. Expressions are covered in a separate post

No comments:

Post a Comment