Navigation: battleWarden:Spy >

Triggers

 

 

Triggers being part of battleWarden:Spy allows you to catch any kind of message battleWarden receives from your game server and perform a custom action. Triggers are created within the Triggers subclass in the battleWarden:Spy configuration file. To accomplish this, add a new subclass with a user-defined name (here: trigger0) as shown in the example below:

class bWSpySettings{

 

          class Log{

            //...

          }

 

          class Triggers{

 

            class trigger0{

                              Type="Log"

                              Pattern="logged in"

                              Call=""

                              Sound="Resources\drum.wav"

            }

 

      }

Each custom trigger subclass has 4 attributes:

Attribute

Description

Type

Specifies the type of the messages to be catched. Values can be Log (for log messages) or Chat (for chat messages).

Pattern

Specifies a regular expression for catching server messages.

Call

Specifies a URL to call when catching a message. You can use <Base64Content> as a variable contaning the catched message encoded with Base64. This attribute can be empty.

Sound

Specifies a .wav sound file to be played when catching a message.

Script

Specifies a path to a battleWarden script file which will be executed when catching a message. Within that script you have to define a function called Main with 1 parameter of the type string. For detailed information, see battleWarden:Script.

You can add an unlimited number of custom triggers. Please make sure that each of these triggers have an individual name (like trigger0, trigger1, ...) in order to avoid collisions.

 

Copyright © 2016 solicus. All Rights Reserved. Last Update: 2016-4-7.