Module:Minimal Example: Difference between revisions

MDFW - The Mystery Dungeon Tree of Information.
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
while true do
while true do
local dungeonArg = args["dungeon_" .. i]
local dungeonArg = args["dungeon_" .. i]
if not dungeonArg then break end -- exit loop when no more rows are found
output:tag('div'):wikitext(data[dungeonArg]["version"]):done()
output:tag('div'):wikitext(data[dungeonArg]["version"]):done()
i = i + 1
end
end


return tostring(output)
return tostring(output)
 
end
end


return p
return p

Revision as of 01:17, 9 November 2024

Documentation for this module may be created at Module:Minimal Example/doc

--------------------------------------------------------------------------------
--
--					Module:Adventure Squad Pokémon dungeons table
--
--------------------------------------------------------------------------------

local p = {}
local mw = require('mw')

function p.main(frame)
	local args = frame.args

	local output = mw.html.create()

	local data = require("Module:Adventure Squad Dungeon Data Cell")
	local metatable = {__index = function () return "" end}
	setmetatable(data, metatable)

	local i = 1
	while true do
		local dungeonArg = args["dungeon_" .. i]
		
		if not dungeonArg then break end -- exit loop when no more rows are found

		output:tag('div'):wikitext(data[dungeonArg]["version"]):done()
		i = i + 1
		end

	return tostring(output)
	end

return p