Module:Itemlist

local getArgs = require('Module:Arguments').getArgs local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args)

local i = 0 local list = {} local IS = require('Module:IS').main local pages = mw.loadData('Module:IS/pages')

for _, arg in pairs(args) do		i = i+1 local item = args[i] local sprite = args[i] if string.match(item, "^%d+") then --Account for quantity for _,page in pairs(pages) do				for _, i in pairs (page.items) do					if string.match(item, "^%d* "..i.."e?s?") then sprite = i					end end end end

if string.match(item, "%(.-%)") and sprite == item then --Account for names in parenthesis sprite = string.gsub(item, "(.-)".." %(.-%)", "%1") end

if string.match(item, "Mystery Egg") then --Account for eggs sprite = "Mystery Egg" end

local sprite = IS({sprite}) if item == "Nothing" then table.insert(list, ""..item.."") else table.insert(list, ""..sprite.." "..item.."") end end

list = table.concat(list, "\n") return ""..list.."" end return p