Module:Static

From Illerai
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Module:Static/doc. [edit] [history] [purge]

This module is a helper module to be used by other modules; it may not designed to be invoked directly. See RuneScape:Lua/Helper modules for a full list and more information. For a full list of modules using this helper click here

FunctionTypeUse
n/aThis module returns a table that can store data that persists in between multiple {{#Invoke:}} calls.

Example:

local p = {}

function p.main()
    local static = require('Module:Static')
    static.x = (static.x or 0) + 1
    return static.x
end

return p

If the above code sample was stored in Module:foo, then {{#Invoke:foo|main}} {{#Invoke:foo|main}} would result in 1 2.


local mwHtml = getmetatable(mw.html.create())
mwHtml._static = mwHtml._static or {}
return mwHtml._static