Module:TestMod

From Hazeron Wiki
Revision as of 11:00, 18 April 2024 by Celarious (talk | contribs) (number seems to be 1 higher than intended)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basic test Lua module, can be invoked with {{#invoke: TestMod|FunctionName|arg1|arg2|etc ...}}


local p = {} --p stands for package

function p.countArgs( frame )
    local args = frame.args
    local i = 1
    while args[i] do i = i + 1 end
    return "You entered " .. i - 1 .. " arguments."
end

return p