Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.GetTriggerList


Name GetTriggerList
Type Method
Summary Gets the list of triggers
Prototype VARIANT GetTriggerList();
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".
Returns 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 ...

Function Description
AddTrigger Adds a trigger
DeleteTrigger Deletes a trigger
EnableTrigger Enables or disables a trigger
GetPluginTriggerList Gets the list of triggers in a specified plugin
GetTrigger Gets details about a named trigger
GetTriggerInfo Gets details about a named trigger
IsTrigger Tests to see if a trigger exists

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.