Module:Test

local i18n = { Id = 'ID', Name = 'Name', Image = 'Image', InternalName = 'Internal name', Deprecated = '(Deprecated)', }

local data={} local unused = require('Module:Iteminfo/idSets').getIdSet('Deprecated') local last = 0 local output = mw.html.create('table'):addClass('terraria sortable lined aligncenter') function printRow(row) local itemid = tonumber(row.itemid) --		if itemid > last + 1 then		for id = last+1, itemid-1 do			if unused[id] then				output = output .. '<tr style="background:-- local tr = output:tag('tr')

tr:tag('td'):wikitext(itemid) tr:tag('td'):wikitext(('%s'):format(row.page, row.name)) tr:tag('td'):wikitext((''):format(row.imagefile)) tr:tag('td'):wikitext(tostring(mw.html.create('code'):wikitext(row.internalname)))

last = itemid end

return { main=function(frame) local header = output:tag('tr') header:tag('th'):wikitext(i18n.Id) header:tag('th'):wikitext(i18n.Name) header:tag('th'):wikitext(i18n.Image) header:tag('th'):wikitext(i18n.InternalName)

-- There are more than 5000 items now. local result = mw.ext.cargo.query(		'Items_new',		'_pageName=page, itemid, name, imagefile, internalname',		{			groupBy = 'itemid',			orderBy = 'itemid',			where = 'itemid IS NOT NULL AND itemid <=4000 AND internalname <> ""',			limit = 5000		}	) for _, row in ipairs(result) do		printRow(row) end local result = mw.ext.cargo.query(		'Items_new',		'_pageName=page, itemid, name, imagefile, internalname',		{			groupBy = 'itemid',			orderBy = 'itemid',			where = 'itemid IS NOT NULL AND itemid > 4000 AND internalname <> ""',			limit = 5000		}	) for _, row in ipairs(result) do		printRow(row) end

return output end, }