GetPluginVariableList
Script function

world.GetPluginVariableList

DOC_scripting Read about scripting

Type

Method

Summary

Gets the list of variables in a specified plugin

Prototype

VARIANT GetPluginVariableList(BSTR PluginID);

DOC_data_types View list of data type meanings


Description

Returns an array of all the variables currently defined for the nominated plugin. You can then use GetPluginVariable to get the value for each one.

If you want to find the list of variables in the current plugin, use "GetVariableList".

If you are writing a plugin and want to find the "global" MUSHclient variable list, use an empty plugin ID, eg.

vList = world.GetPluginVariableList ("")



VBscript example

dim varList

varList = world.GetPluginVariableList ("982581e59ab42844527eec80")

If Not IsEmpty (varList) Then

  For Each v In varList 
    world.note v & " = " &  world.GetPluginVariable ("982581e59ab42844527eec80", v)
  Next

End If



Jscript example

varList = new VBArray(world.GetPluginVariableList("982581e59ab42844527eec80")).toArray();

if (varList)  // if not empty
 for (i = 0; i < varList.length; i++)
   world.note(varList [i] + " = " + 
         world.GetPluginVariable("982581e59ab42844527eec80", varList [i]));



PerlScript example

foreach $item (Win32::OLE::in ($world->GetPluginVariableList ("982581e59ab42844527eec80")))
 {
 ($key, $value) = ($item, $world->GetPluginVariable ("982581e59ab42844527eec80", $item));
 $world->note($key . " = " . $value) if (defined ($key));
 }



Python example

variablelist = world.GetPluginVariableList("982581e59ab42844527eec80")
if (variablelist ):
  for v in variablelist : world.Note (v + " = " +
                  world.GetPluginVariable("982581e59ab42844527eec80", v))



Lua example

-- show all variables and their values

for k, v in pairs (GetPluginVariableList("982581e59ab42844527eec80")) do 
  Note (k, " = ", v) 
end



Lua notes

Under Lua this function returns a table of all variables and their values, 
keyed by the variable name.

Thus you can directly access variables from the table, like this:

-- show value for variable "victim" in plugin ID "982581e59ab42844527eec80" ...

print (GetPluginVariableList("982581e59ab42844527eec80").victim)



Return value

If there are no variables then the return value is empty. Use "IsEmpty" to test for this possibility.

If the nominated plugin does not exist, then the return value is NULL. Use "IsNull" to test for this possibility.

Otherwise, it returns a variant array containing the names of all the variables in the specified plugin. Use "ubound" to find the number of variables in the list. You can then use "GetPluginVariable" to find details about each variable.




See Also ...

Topics

DOC_aliases Aliases
DOC_Arrays Arrays
DOC_plugins Plugins
DOC_scripting Scripting
DOC_timers Timers
DOC_triggers Triggers
DOC_variables Variables

Functions

FNC_BroadcastPlugin BroadcastPlugin (Broadcasts a message to all installed plugins)
FNC_CallPlugin CallPlugin (Calls a routine in a plugin)
FNC_EnablePlugin EnablePlugin (Enables or disables the specified plugin)
FNC_GetPluginID GetPluginID (Returns the 24-character ID of the current plugin)
FNC_GetPluginInfo GetPluginInfo (Gets details about a specified plugin)
FNC_GetPluginList GetPluginList (Gets a list of installed plugins.)
FNC_GetPluginName GetPluginName (Returns the name of the current plugin)
FNC_GetPluginTimerInfo GetPluginTimerInfo (Gets details about a named timer for a specified plugin)
FNC_GetPluginTimerList GetPluginTimerList (Gets the list of timers in a specified plugin)
FNC_GetPluginVariable GetPluginVariable (Gets the contents of a variable belonging to a plugin)
FNC_GetPluginVariableList GetPluginVariableList (Gets the list of variables in a specified plugin)
FNC_GetVariable GetVariable (Gets the contents of a variable)
FNC_GetVariableList GetVariableList (Gets the list of variables)
FNC_IsPluginInstalled IsPluginInstalled (Checks to see if a particular plugin is installed)
FNC_LoadPlugin LoadPlugin (Loads a plugin from disk)
FNC_PluginSupports PluginSupports (Checks if a plugin supports a particular routine)
FNC_ReloadPlugin ReloadPlugin (Reloads an installed plugin)
FNC_SaveState SaveState (Saves the state of the current plugin)

(Help topic: function=GetPluginVariableList)

DOC_contents Documentation contents page