Module:Sandbox/PhantomCaleb

local p = {} local h = {}

local DataTable = require("Module:Data Table") local utilsCargo = require("Module:UtilsCargo") local utilsLayout = require("Module:UtilsLayout") local utilsTable = require("Module:UtilsTable")

function p.Main(frame) local args = frame.args local game = args[1]

local oldData = utilsCargo.query("Armor", "armor, level, defense, sellPrice, materials, description", {		limit = 1000,		sortBy = "armor, level",		where = utilsCargo.allOf({ game = game })	})	local newData = utilsCargo.query("ArmorLevels", "armor, level, defense, sellPrice, materials, description", {		limit = 1000,		sortBy = "armor, level",		where = utilsCargo.allOf({ game = game })	})

local diffIndices = {} for i in ipairs(oldData) do		if newData[i].level then newData[i].description = nil oldData[i].description = nil end if not utilsTable.isEqual(oldData[i], newData[i]) and oldData[i] then table.insert(diffIndices, i)		end end local diffRows = utilsTable.map(diffIndices, function(i)		return {			oldData[i].armor,			oldData[i].description,			newData[i].description,		}	end) local table = utilsLayout.table({		headers = {"Armor", "Old Description", "New Description"},		rows = diffRows,	})

local count = " Count: "..#diffRows.." "

return count..table end

return p