The VariablesLua extension provides support for the Variables extension in Lua modules by the Scribunto extension.
Manual: Liquipedia Help
The extension can be loaded in Lua modules by the Scribunto extension like this:
VariablesLua = mw.ext.VariablesLua
Functions are based on the ones provided by the Variables extension, adding some more utility.
VariablesLua.vardefine[edit]VariablesLua.vardefine( name, value )
Stores the given value under the given name. An empty string is stored if the value is nil
.
VariablesLua.vardefineecho( name, value )
Identical to VariablesLua.vardefine, but returns the value after storing it.
VariablesLua.var( name, default )
Retrieve a variable stored under the given name.
VariablesLua.varexists[edit]VariablesLua.varexists( name )
Check if a variable exists. Returns a boolean value.
VariablesLua.var_final[edit]VariablesLua.var_final( name, default )
Returns the last value stored (i.e. the last VariablesLua.vardefine or #vardefine in the code). The value can only be returned and not used in the Lua code.
VariablesLua
in your extensions/
folder.wfLoadExtension( 'VariablesLua' );
mw.ext.VariablesLua.varexists()
on newer versions of Extension:Variables.mw.ext.VariablesLua.var_table()
.mw.ext.VariablesLua.var_table()
due to changes in Extension:Variables.mw.ext.VariablesLua.varexists()
.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4