Hi all
I am the author of a small addon called Aardvark; the addon will auto destroy listed items when a vendor window is opened.
Since 90002 when I visit a vendor the destroy item messages print but the items themselves are not deleted; no matter how many times I close and reopen the vendor window the messages print about the items never leave my bags.
I can run the destroy function manually after I have already opened the vendor window and then the items are destroyed.
This is the error I get;
Lua Code:
1x [ADDON_ACTION_BLOCKED] AddOn 'Aardvark' tried to call the protected function 'UNKNOWN()'.
[string "@!BugGrabber\BugGrabber.lua"]:519: in function <!BugGrabber\BugGrabber.lua:519>
[string "=[C]"]: ?
[string "=[C]"]: in function `DeleteCursorItem'
[string "@Aardvark\Aardvark-AR 10.8.9.0.lua"]:2112: in function <Aardvark\Aardvark.lua:2084>
[string "@Aardvark\Aardvark-AR 10.8.9.0.lua"]:2490: in function <Aardvark\Aardvark.lua:2482>
I cannot work out why I get the UNKNOWN() error, or why it works fine if the vendor window is already opened.
This is my destroy function which fires on the "MERCHANT_SHOW" event;
Lua Code:
local function avkDestroy()
local destroyedItemCount = 0 -- Destroyed items counting variable
local destroyedSlotCount = 0
-- Destroyed slots counting variable
for destroyBag = 0, 4 do -- Check each bag
destroyBagSlot = GetContainerNumSlots(destroyBag)
for destroySlot = 0, destroyBagSlot do -- Check each bag slot
currentItemID = GetContainerItemID(destroyBag, destroySlot)
if currentItemID then -- If current bag slot has an item then get the item info
local _, itemLink, _, _, _, _, _, _, _, _, itemValue = GetItemInfo(currentItemID)
local _, itemCount, _, _, _, _, _, _ = GetContainerItemInfo(destroyBag, destroySlot)
if
checkItemOnGlobalProtectList(currentItemID) or
checkItemOnCharacterProtectList(currentItemID) and itemValue == 0
then
if AVKGlobalSettings.Destroy.dddm and AVKGlobalSettings.Protect.pdpm then -- Print protected item
if itemLink then
print(" - Protected: " .. itemLink .. " not destroyed.")
end
end
elseif checkItemOnGlobalDestroyList(currentItemID) or checkItemOnCharacterDestroyList(currentItemID) then
destroyedItemCount = destroyedItemCount + itemCount
destroyedSlotCount = destroyedSlotCount + 1
-- If item Destroy messages are on print
if AVKGlobalSettings.Destroy.dddm then -- Print each item destroyed
print(" - Destroyed: " .. itemCount .. " " .. itemLink)
end
PickupContainerItem(destroyBag, destroySlot)
DeleteCursorItem() -- Destroy current item
end
end
end
end
if destroyedSlotCount ~= 0 then -- If items were destroyed print out total -- If no items destroyed print out bag space message
print(
ColourList.textBluePrefixSuffix ..
ColourList.textRed ..
"Items destroyed :-|r " ..
destroyedItemCount .. ColourList.textRed .. " ~ Bagslots cleared :-|r " .. destroyedSlotCount
)
elseif AVKGlobalSettings.Destroy.dntdm then
print(ColourList.textBluePrefixSuffix .. ColourList.textRed .. "Nothing destroyed. No bag space saved.")
end
end
And here is my full code.
I am really stumped with this one, and I am looking for some help to get this going again.