Module:Bongolium500/learning: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
No edit summary
Line 1: Line 1:
local p = {} --p stands for package
function p.pipeTest( frame )
local test1 = {["first"] = "first2", ["second"] = "second2"}
arg = frame.agrs[1]
local test2 = {}
if arg == "|" then
local text = "Pipe"
function p.hello( frame )
elseif arg == "{!}" then
test2[1] = test1["first"]
local text = "Fake Pipe"
test2[test1["second"]] = test1["second"]
end
    return test2[1] .. test2["second2"]
return text
end
end


return p
return p

Revision as of 11:04, 28 December 2021

Lua error at line 1: attempt to index global 'p' (a nil value).


function p.pipeTest( frame )
	arg = frame.agrs[1]
	if arg == "|" then
		local text = "Pipe"
	elseif arg == "{!}" then
		local text = "Fake Pipe"
	end
	return text
end

return p