Template:Sandbox

MDFW - The Mystery Dungeon Tree of Information.
Revision as of 05:05, 23 October 2023 by Golisopod (talk | contribs)
Jump to navigation Jump to search

-- -- Module:Rescue Team DX Pokémon Locations table --


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

function p.main(frame) local args = frame.args local output = {} -- Header row

table.insert(output, '

') table.insert(output, '') table.insert(output, '') table.insert(output, '') table.insert(output, '') table.insert(output, '') table.insert(output, '') table.insert(output, '') -- Data rows for i = 1, 100 do local locationArg = args["location_" .. i] local floorsArg = args["floors_" .. i] local levelsArg = args["levels_" .. i] local methodArg = args["method_" .. i] local spawnArg = args["spawnrate_" .. i] if not locationArg and not floorsArg and not levelsArg and not methodArg and not spawnArg then break -- exit loop when no more rows are found end local rowData = {} table.insert(rowData, '') if locationArg then table.insert(rowData, '')

else

table.insert(rowData, '') table.insert(rowData, '') table.insert(rowData, '')

end

table.insert(rowData, '')

end

table.insert(rowData, '') table.insert(output, table.concat(rowData)) end table.insert(output, '
LocationFloors' .. frame:expandTemplate{title = "RescueTeamDX", args = {"Levels"}} .. 'MethodSpawn Rate
' .. frame:expandTemplate{title = "RescueTeamDX", args = {locationArg}} .. '' .. frame:expandTemplate{title = "Research"} .. '' .. frame:expandTemplate{title = "Research"} .. '' .. frame:expandTemplate{title = "Research"} .. '' .. (levelArg or frame:expandTemplate{title = "Research"}) .. '

')

return table.concat(output) end

return p