Module:Static

From Illerai

This is the current revision of this page, as edited by imported>BigDiesel2m at 02:35, 4 November 2024 (Created page with "local mwHtml = getmetatable(mw.html.create()) mwHtml._static = mwHtml._static or {} return mwHtml._static"). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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