Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Liquipedia/VariablesLua

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

local p = {} -- p stands for package
function p.get(frame)
	local data = mw.ext.VariablesLua.var('variablename')
	-- data now holds the value of the variable "variablename"
	return data
end
function p.set(frame)
	mw.ext.VariablesLua.vardefine('variablename', 'variablevalue')
	-- The variable "variablename" now holds the value "variablevalue"
end
function p.setecho(frame)
	local data = mw.ext.VariablesLua.vardefineecho('variablename', 'variablevalue')
	-- The variable "variablename" now holds the value "variablevalue"
	-- data now has the value "variablevalue"
	return data
end
return p

About

A Scribunto Lua interface for Extension:Variables

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors 4

AltStyle によって変換されたページ (->オリジナル) /