GetTriggerList
Script function

world.GetTriggerList

DOC_scripting Read about scripting

Type

Method

Summary

Gets the list of triggers

Prototype

VARIANT GetTriggerList();

DOC_data_types 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

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_GetTriggerOption GetTriggerOption (Gets the value of a named trigger option)
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=GetTriggerList)

DOC_contents Documentation contents page