| Name | AddTriggerEx |
|---|---|
| Type | Method |
| Summary | Adds a trigger - extended arguments |
| Prototype | long
AddTriggerEx(BSTR TriggerName, BSTR MatchText, BSTR ResponseText, long Flags,
short Colour, short Wildcard, BSTR SoundFileName, BSTR ScriptName, short
SendTo, short Sequence); |
| Description | Adds
a trigger to the list of triggers. If you are prepared to accept the default
values for Sequence and "Send To" you can use AddTrigger instead. For AddTrigger they default to: Sequence: 100 Send to: world Name: name of this trigger - may be empty Match_text: what to match on Response_text: what to send back to the world Flags: various flags, see list below Colour: what colour to draw triggered text, see list below Wildcard: Copy which wildcard to the clipboard (0 = none), otherwise 1 to 10. SoundFileName: Which sound file to play ScriptName: Which script subroutine to execute Sequence: Sequence number of trigger (lower is evaluated earlier). Must be in range 0 to 10,000 Send To: Where to send the trigger text to ... 0 - Send To World 1 - Send To Command 2 - Send To Output 3 - Send To Status Line 4 - Send To Notepad (New) 5 - Send To Notepad (Append) 6 - Send To Log File 7 - Send To Notepad (Replace) 8 - Send To World (Speedwalk delay) 9 - Send To Variable (Label is name) Flags The flags can be one or more of the constants below. For example, to omit from log and omit from output, the flags would be 6. Preferably use the constant declarations in your script file, and "OR" them together. E.g. VBscript: eOmitFromLog or eOmitFromOutput JScript: eOmitFromLog | eOmitFromOutput VBscript: const eEnabled = 1 ' enable trigger const eOmitFromLog = 2 ' omit from log file const eOmitFromOutput = 4 ' omit trigger from output const eKeepEvaluating = 8 ' keep evaluating const eIgnoreCase = 16 ' ignore case when matching const eTriggerRegularExpression = 32 ' trigger uses regular expression const eExpandVariables = 512 ' expand variables like @direction const eReplace = 1024 ' replace existing trigger of same name const eTemporary = 16384 ' temporary - do not save to world file JScript: var eEnabled = 1; // enable trigger var eOmitFromLog = 2; // omit from log file var eOmitFromOutput = 4; // omit trigger from output var eKeepEvaluating = 8; // keep evaluating var eIgnoreCase = 16; // ignore case when matching var eTriggerRegularExpression = 32; // trigger uses regular expression var eExpandVariables = 512; // expand variables like @direction var eReplace = 1024; // replace existing trigger of same name var eTemporary = 16384; // temporary - do not save to world file PerlScript constants: $eEnabled = 1; # enable trigger $eOmitFromLog = 2; # omit from log file $eOmitFromOutput = 4; # omit trigger from output $eKeepEvaluating = 8; # keep evaluating $eIgnoreCase = 16; # ignore case when matching $eTriggerRegularExpression = 32; # trigger uses regular expression $eExpandVariables = 512; # expand variables like @direction $eReplace = 1024; # replace existing trigger of same name $eTemporary = 16384; # temporary - do not save to world file Colours VBscript: const NOCHANGE = -1 const custom1 = 0 const custom2 = 1 const custom3 = 2 const custom4 = 3 const custom5 = 4 const custom6 = 5 const custom7 = 6 const custom8 = 7 const custom9 = 8 const custom10 = 9 const custom11 = 10 const custom12 = 11 const custom13 = 12 const custom14 = 13 const custom15 = 14 const custom16 = 15 JScript: var NOCHANGE = -1; var custom1 = 0; var custom2 = 1; var custom3 = 2; var custom4 = 3; var custom5 = 4; var custom6 = 5; var custom7 = 6; var custom8 = 7; var custom9 = 8; var custom10 = 9; var custom11 = 10; var custom12 = 11; var custom13 = 12; var custom14 = 13; var custom15 = 14; var custom16 = 15; PerlScript: $NOCHANGE = -1; $custom1 = 0; $custom2 = 1; $custom3 = 2; $custom4 = 3; $custom5 = 4; $custom6 = 5; $custom7 = 6; $custom8 = 7; $custom9 = 8; $custom10 = 9; $custom11 = 10; $custom12 = 11; $custom13 = 12; $custom14 = 13; $custom15 = 14; $custom16 = 15; Note: Available in MUSHclient version 3.18 onwards. |
| VBscript example | |
| Jscript example | |
| PerlScript example | $world->AddTriggerEx ("", "* attacks", "You are under attack!", 1, 14, 0, "", "", 2, 50); |
| Returns | eInvalidObjectLabel: The trigger name is not valid |
See also ...