Module:Spawn table

local p = {}

function p.mobSpawnTable(frame) local args = frame if frame == mw.getCurrentFrame then args = require('Module:ProcessArgs').merge( true ) else frame = mw.getCurrentFrame end local output = {}	-- list of strings to be concatenated into final output local columns = {'Mob', 'Weight', 'Group size'} local title = 'Mob spawn list' -- create final output table.insert(output, '{| class = "wikitable"') table.insert(output, '|-') table.insert(output, '! colspan = ' .. #columns .. ' | ' .. title) table.insert(output, '|-') local columnsStr = '! '	for i, value in pairs(columns) do		if i ~= 1 then columnsStr = columnsStr .. ' !! '		end columnsStr = columnsStr .. ' ' .. value end table.insert(output, columnsStr) table.insert(output, '|-') table.insert(output, '|}') return table.concat(output, '\n') end

return p