GetTriggerOption
Script function

world.GetTriggerOption

DOC_scripting Read about scripting

Type

Method

Summary

Gets the value of a named trigger option

Prototype

VARIANT GetTriggerOption(BSTR TriggerName, BSTR OptionName);

DOC_data_types View list of data type meanings


Description

Gets the current value of a trigger option.

You must specify the name of an existing trigger, and a trigger option from the list below. These are the same names as used in the XML world files for trigger options.

The return type is Variant, so the returned value will be the appropriate type for the data (ie. string or number (long)).

If the option name is not known, or is not allowed to be retrieved, a NULL variant is returned.

If the named trigger does not exist, EMPTY is returned. If the name given is invalid, NULL is returned. If the option name is not known, EMPTY is returned. (Use "IsEmpty" and "IsNull" to test for these possibilities).

For a detailed description about the meanings of the fields, see AddTrigger.

If GetTriggerOption is called from within a plugin, the triggers for the current plugin are used, not the "global" MUSHclient triggers.

OPTION NAMES

"clipboard_arg" - which wildcard to copy to clipboard
"colour_change_type" - whether trigger changes text (1), background (2), or both (0)
"custom_colour" - custom colour number to display
"enabled" - enabled flag
"expand_variables" - expand variables flag
"group" - group name
"ignore_case" - ignore case flag
"keep_evaluating" - keep evaluating flag
"lines_to_match" - how many lines to match for multi-line trigger
"lowercase_wildcard" - force wildcards to lowercase flag
"match" - what to match on
"match_style" - the style to match on
"multi_line" - multi-line trigger flag
"new_style" - the new style
"omit_from_log" - omit from log file flag
"omit_from_output" - omit from output flag
"one_shot" - one shot flag
"other_back_colour" - colour to set background if "custom_colour" is 17 (RGB colour number)
"other_text_colour" - colour to set text if "custom_colour" is 17 (RGB colour number)
"regexp" - regular expression flag
"repeat" - repeat on same line flag
"script" - script routine to call
"send" - what to send
"send_to" - where to send it - see GetTriggerInfo for values
"sequence" - sequence number
"sound" - sound to play
"sound_if_inactive" - play sound if world is inactive flag
"user" - user value (for scripting)
"variable" - variable to set



VBscript example

world.note world.GetTriggerOption ("mytrigger", "match")



Jscript example

world.note (world.GetTriggerOption ("mytrigger", "match"));



PerlScript example

$world->note ($world->GetTriggerOption ("mytrigger", "match"));



Python example

world.note (world.GetTriggerOption ("mytrigger", "match"))



Lua example

Note (GetTriggerOption ("mytrigger", "match"))



Lua notes

Lua returns nil where applicable instead of an "empty variant" or "null variant".



Return value

As described above.




See Also ...

Topics

DOC_aliases Aliases
DOC_defaults Default triggers/aliases/timers/macros/colours
DOC_starting Getting started
DOC_group Groups
DOC_plugins Plugins
DOC_regexp Regular Expressions
DOC_timers Timers
DOC_triggers Triggers

Functions

FNC_AddTrigger AddTrigger (Adds a trigger)
FNC_AddTriggerEx AddTriggerEx (Adds a trigger - extended arguments)
FNC_DeleteTemporaryTriggers DeleteTemporaryTriggers (Deletes all temporary triggers)
FNC_DeleteTrigger DeleteTrigger (Deletes a trigger)
FNC_DeleteTriggerGroup DeleteTriggerGroup (Deletes a group of triggers)
FNC_EnableTrigger EnableTrigger (Enables or disables a trigger)
FNC_EnableTriggerGroup EnableTriggerGroup (Enables/disables a group of triggers)
FNC_GetPluginTriggerInfo GetPluginTriggerInfo (Gets details about a named trigger for a specified plugin)
FNC_GetPluginTriggerList GetPluginTriggerList (Gets the list of triggers in a specified plugin)
FNC_GetTrigger GetTrigger (Gets details about a named trigger)
FNC_GetTriggerInfo GetTriggerInfo (Gets details about a named trigger)
FNC_GetTriggerList GetTriggerList (Gets the list of triggers)
FNC_GetTriggerWildcard GetTriggerWildcard (Returns the contents of the specified wildcard for the named trigger)
FNC_IsTrigger IsTrigger (Tests to see if a trigger exists)
FNC_SetTriggerOption SetTriggerOption (Sets the value of a named trigger option)

(Help topic: function=GetTriggerOption)

DOC_contents Documentation contents page