Template:Sandbox: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 33: | Line 33: | ||
table.insert(rowData, '<tr class="itemsTableRow">') | table.insert(rowData, '<tr class="itemsTableRow">') | ||
if locationArg then | if locationArg then | ||
table.insert(rowData, '<td class="templateSecondary">' .. frame:expandTemplate{title = "RescueTeamDX", args = { | table.insert(rowData, '<td class="templateSecondary">' .. frame:expandTemplate{title = "RescueTeamDX", args = {locationArg}} .. '</td>') | ||
else | else | ||
table.insert(rowData, '<td class="templateSecondary">' .. frame:expandTemplate{title = "Research"} .. '</td>') | table.insert(rowData, '<td class="templateSecondary">' .. frame:expandTemplate{title = "Research"} .. '</td>') |
Revision as of 05:05, 23 October 2023
-- -- 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, 'Location | Floors | ' .. frame:expandTemplate{title = "RescueTeamDX", args = {"Levels"}} .. ' | Method | Spawn 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