Skip to content

Repository files navigation

VariablesLua

Code Style

This extension makes Extension:Variables work with Scribunto Lua. See https://liquipedia.net/commons/Help:VariablesLua for more information.

Installation

  • Extract the extension folder to extensions/VariablesLua/
  • Add the following line to LocalSettings.php:
wfLoadExtension( 'VariablesLua' );

Dependencies

This extension requires Extension:Variables and Extension:Scribunto to be installed.

Examples

This is how some example calls to the extension could look like in a Scribunto module

localp= {} -- p stands for packagefunctionp.get(frame)
localdata=mw.ext.VariablesLua.var('variablename')
-- data now holds the value of the variable "variablename"returndataendfunctionp.set(frame)
mw.ext.VariablesLua.vardefine('variablename', 'variablevalue')
-- The variable "variablename" now holds the value "variablevalue"endfunctionp.setecho(frame)
localdata=mw.ext.VariablesLua.vardefineecho('variablename', 'variablevalue')
-- The variable "variablename" now holds the value "variablevalue"-- data now has the value "variablevalue"returndataendreturnp

About

A Scribunto Lua interface for Extension:Variables

Topics

Resources

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages