From b851921ea9c81ec9c96c106eb2c9048b04e85ecd Mon Sep 17 00:00:00 2001 From: icecool Date: Fri, 1 Feb 2019 13:15:03 -0600 Subject: [PATCH] Portal Inventory Clean Up Optimization Code setup to dump inventory data into a new temporary table. Once table is full, I parse that table against the PortalInventory table and create a PortalList table which is all portals that need to be put away. --- EquipmentManager.xml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/EquipmentManager.xml b/EquipmentManager.xml index 1bab5eb..ff24d82 100644 --- a/EquipmentManager.xml +++ b/EquipmentManager.xml @@ -74,7 +74,7 @@ WISH LIST: match="^(?\d+),\w+,.*,(?\d+),(?\d+),\d+,(?.*),.*$" > - + @@ -532,6 +526,18 @@ function InventoryManager.InventoryCleanUp() end InvList = { } end +function InventoryManager.ProcessPortalCleanUpList() + for invdata, value in pairs(PortalInventory) do + for portal, objid in pairs(temporaryPortalList) do + if objid == value then + dnote(("%s @wInventoryManager.ProcessPortalCleanUpList added portal(@R%s@w) to PortalList for cleanup.@w"):format(Prepend, objid)) + table.insert(PortalList, 1, objid) + break + end + end + end + InventoryManager.PortalCleanUp() +end function InventoryManager.PortalCleanUp() if #PortalList == 0 then dnote(("%s InventoryManager.PortalCleanUp() is reporting PortalList as emtpy."):format(Prepend)) @@ -543,6 +549,7 @@ function InventoryManager.PortalCleanUp() SendNoEcho(("put %s %d"):format(PortalList[obj], EqCheckSettings.PortalBag)) end InvList = { } + end ]]> \ No newline at end of file