Module:TestMod: Difference between revisions

From Hazeron Wiki
Jump to navigation Jump to search
(k so what's the frame do)
(removed bad code)
Tag: Manual revert
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {} --p stands for package
local p = {} --p stands for package


function p.hello( arg )
function p.hello( frame )
     return "Hello, world!"
    local args = frame.args
     return "This should have printed the first argument you entered: " .. args[1] .. "!"
end
end


return p
return p

Revision as of 16:21, 17 April 2024

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


local p = {} --p stands for package

function p.hello( frame )
    local args = frame.args
    return "This should have printed the first argument you entered: " .. args[1] .. "!"
end

return p