[Home] [Downloads] [Search] [Help/forum]

GetPluginVariableList

Script function

world.GetPluginVariableList

Read about scripting

Type

Method

Summary

Gets the list of variables in a specified plugin

Prototype

VARIANT GetPluginVariableList(BSTR PluginID);

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 ("")


Available in MUSHclient version 3.23 onwards.



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

Aliases
Arrays
Plugins
Scripting
Timers
Triggers
Variables

Functions

(BroadcastPlugin) Broadcasts a message to all installed plugins
(CallPlugin) Calls a routine in a plugin
(EnablePlugin) Enables or disables the specified plugin
(GetPluginID) Returns the 24-character ID of the current plugin
(GetPluginInfo) Gets details about a specified plugin
(GetPluginList) Gets a list of installed plugins.
(GetPluginName) Returns the name of the current plugin
(GetPluginTimerInfo) Gets details about a named timer for a specified plugin
(GetPluginTimerList) Gets the list of timers in a specified plugin
(GetPluginVariable) Gets the contents of a variable belonging to a plugin
(GetVariable) Gets the contents of a variable
(GetVariableList) Gets the list of variables
(IsPluginInstalled) Checks to see if a particular plugin is installed
(LoadPlugin) Loads a plugin from disk
(PluginSupports) Checks if a plugin supports a particular routine
(ReloadPlugin) Reloads an installed plugin
(SaveState) Saves the state of the current plugin
(UnloadPlugin) Unloads an installed plugin

(Help topic: function=GetPluginVariableList)

Documentation contents page


Search ...

Enter a search string to find matching documentation.

Search for:   

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]