Script function
world.GetTriggerList
Read about scripting
Type
Method
Summary
Gets the list of triggers
Prototype
VARIANT GetTriggerList();
View list of data type meanings
Description
Returns an array of all the named triggers currently defined. You can then use GetTrigger or GetTriggerInfo to find out more details about each one.
If GetTriggerList is called from within a plugin, the triggers for the current plugin are used, not the "global" MUSHclient triggers.
If you want to find the list of triggers in another plugin, or the global MUSHclient triggers, use "GetPluginTriggerList".
Note - from version 3.30 onwards GetTriggerList returns all triggers, even unlabelled ones. The unlabelled triggers will have assigned an "internal" label (like "*trigger42") that can be used in GetTriggerInfo, and similar routines.
VBscript example
dim trList
trList = world.GetTriggerList
If Not IsEmpty (trList) then
For Each t In trList
world.Note t
Next
End If
Jscript example
triggerlist = new VBArray(world.GetTriggerList()).toArray();
if (triggerlist) // if not empty
for (i = 0; i < triggerlist.length; i++)
world.note(triggerlist [i]);
PerlScript example
foreach $item (Win32::OLE::in ($world->GetTriggerList))
{
$world->note($item);
}
Python example
triggerlist = world.GetTriggerList
if (triggerlist ):
for t in triggerlist : world.Note (t)
Lua example
tl = GetTriggerList()
if tl then
for k, v in ipairs (tl) do
Note (v)
end -- for
end -- if we have any triggers
Lua notes
Lua returns nil where applicable instead of an "empty variant".
Return value
If there are no triggers (with names) then the return value is empty. Use "IsEmpty" to test for this possibility.
Otherwise, it returns a variant array containing the names of all the triggers. Use "ubound" to find the number of triggers in the list. You can then use "GetTrigger" to find details about each trigger. See the example for how to do this. You can paste this example into an "Immediate" window (CTRL+I) to test it.
See Also ...
Topics
Aliases
Default triggers/aliases/timers/macros/colours
Getting started
Groups
Plugins
Regular Expressions
Timers
Triggers
Functions
(AddTrigger) Adds a trigger
(AddTriggerEx) Adds a trigger - extended arguments
(DeleteTemporaryTriggers) Deletes all temporary triggers
(DeleteTrigger) Deletes a trigger
(DeleteTriggerGroup) Deletes a group of triggers
(EnableTrigger) Enables or disables a trigger
(EnableTriggerGroup) Enables/disables a group of triggers
(GetPluginTriggerInfo) Gets details about a named trigger for a specified plugin
(GetPluginTriggerList) Gets the list of triggers in a specified plugin
(GetTrigger) Gets details about a named trigger
(GetTriggerInfo) Gets details about a named trigger
(GetTriggerOption) Gets the value of a named trigger option
(GetTriggerWildcard) Returns the contents of the specified wildcard for the named trigger
(IsTrigger) Tests to see if a trigger exists
(SetTriggerOption) Sets the value of a named trigger option
(StopEvaluatingTriggers) Stops trigger evaluation
(Help topic: function=GetTriggerList)