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

MUSHclient scripting

Description of MUSHclient world function: world.GetPluginVariableList

Name GetPluginVariableList
Type Method
Summary Gets the list of variables in a specified plugin
Prototype VARIANT GetPluginVariableList(BSTR PluginID);

View list of data type meanings


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

Note: Available in 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)

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) 
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)
Returns 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.
Introduced in version 3.23

See also ...

Function Description
GetPluginVariableList Gets the list of variables in a specified plugin
GetVariable Gets the contents of a variable
GetVariableList Gets the list of variables

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


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.


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]