@ -74,7 +74,7 @@ WISH LIST:
match="^(?<objid > \d+),\w+,.*,(?<objlevel > \d+),(?<objtype > \d+),\d+,(?<objwear > .*),.*$" ></trigger>
<trigger name= "InvDataPortCleanData" group= "GroupPortalCleanUp" enabled= "n" regexp= "y" omit_from_output= "y" sequence= "100" script= "TRIGGER_AddInvPortalListItem"
match="^(?<objid > \d+),\w+,.*,(?<objlevel > \d+),(?<objtype > \d+),\d+,(?<objwear > .*),.*$" ></trigger>
<!-- Triggers for Portal Inventory Clean Up -->
<!-- Triggers for InvData end -->
<trigger name= "InvDataEnd" group= "GroupEqSync" enabled= "n" regexp= "y" omit_from_output= "y" sequence= "100" script= "TRIGGER_EndInvData"
match="^\{\/invdata\}$"></trigger>
<trigger name= "InvDataInvCleanUpEnd" group= "GroupInventoryCleanup" enabled= "n" regexp= "y" omit_from_output= "y" sequence= "100" script= "TRIGGER_EndInvData"
@ -449,8 +449,7 @@ function TRIGGER_AddPortalInvItem( name, line, args )
dnote(("%s TRIGGER_AddPortalItem did not provide an argument for objid"):format(Prepend))
return
end
local obj_id = tostring(args.objid)
table.insert(PortalInventory, 1, obj_id)
table.insert(PortalInventory, 1, tostring(args.objid))
dnote(("%s TRIGGER_AddPortalItem(%s) called. Added %s to PortalInventory table."):format(Prepend, obj_id, obj_id))
cnote(("%s Portal(%s) was added Portal Inventory."):format(Prepend, obj_id))
end
@ -459,14 +458,8 @@ function TRIGGER_AddInvPortalListItem( name, line, args )
dnote(("%s TRIGGER_CreateInventoryPortalListItem() did not have an args.objid argument."):format(Prepend))
return
end
local objid = tostring(args.objid)
for obj, list in pairs(PortalInventory) do
if PortalInventory[obj] == objid then
table.insert(PortalList, 1, objid)
dnote(("%s TRIGGER_CreateInventoryPortalListItem added Object ID#%s to PortalList table."):format(Prepend,objid))
return
end
end
if not temporaryPortalList then temporaryPortalList = {} end
table.insert( temporaryPortalList, 1, tostring(args.objid) )
end
function TRIGGER_EndInvData( name, line, args )
if name == "InvDataEnd" then
@ -486,7 +479,8 @@ function TRIGGER_EndInvData( name, line, args )
elseif name == "InvDataPortCleanEnd" then
EnableTriggerGroup("GroupInvDataStart", false)
EnableTriggerGroup("GroupPortalCleanUp", false)
InventoryManager.PortalCleanUp()
dnote(("%s Now creating a temporary 'inventory' table to then process against PortalInventory table."):format(Prepend))
InventoryManager.ProcessPortalCleanUpList()
end
end
]]> </script>
@ -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
]]> </script>
</muclient>