Module:IterativeInventorySlot

local getArgs = require('Module:Arguments').getArgs

local p = {}

local table = require('Module:Table') local string = require('Module:String')

function p.main(frame) args = getArgs(frame) -- Process wikitext return frame:preprocess(p.writeSlot(args)) end

function p.writeSlot(args) local iterations = args[1] local item = args[2] local link = args[3] local title = args[4] local iterationList = string.split(args[5],'%s*,%s*') --Split text via pattern that matches comma seperators (ex: "5, 6, 7, 8") -> { 5, 6, 7, 8 } local textOne = args[6] local textTwo = args[7] local text = {} iterationList = convertValues(iterationList) -- Iterate over iterations for i=1, tonumber(iterations) do		-- Insert text into table table.push(text, table.concat{			' ',		}) end -- Finish joining text return table.concat(text) end

function convertValues(list) local values = {} for j=1, table.length(list,true) do		values[j] = string._formatNum(list[j]) end return values end

return p