Items leaving inventory are not identified
If a item is destroyed,refined,moved to other bag, the events deliver no response about the bagId and slotId.
Only if moved in a valid bag there is a second response with the new bagId/slotId but not the old. Is there a way to identify the item which was destroyed/moved? Up to now i made a snapshot of the whole inventory at login with all valid items and compare it with new inventory after a event was fired. But this is not 100% secure... Any ideas? |
I'm not sure if theis event is called all the time if an item gets destroyed, researched, refined, deconstructed, but maybe it helps?
--Will normally be called if item get's picked up by drag&drop for example, but should be used too if an item gets locked by some function EVENT_INVENTORY_SLOT_LOCKED Doesn't EVENT_INVENTORY_SINGLE_SLOT_UPDATE work for you, or is it only called AFTER the item is destroyed and you don#t have the information of bagId and slotIndex anymore then? Otherwise you might have to hook all the possible functions, or events, where items can be "destroyed", like EVENT_CRAFT_START for example or EVENT_MOUSE_REQUEST_DESTROY_ITEM etc. But some of them do not provide you the bagId and slotIndex of the current item. |
EVENT_INVENTORY_SINGLE_SLOT_UPDATE returns only a bagId/slotId if there was a valid target bag:
BACKPACK > BANK = 2 returns nil/nil and targetBag/targetSlot BACKPACK > NIRVANA = nil/nil EVENT_MOUSE_REQUEST_DESTROY_ITEM does not return bag or slot. EVENT_INVENTORY_SLOT_LOCKED i don't know, can try it ... but when it is called? |
Shared inventory fires callback when slot (item) is removed:
Lua Code:
http://esodata.uesp.net/current/src/...y.lua.html#254 |
Very nice Garkin, this will save me 400 lines of code and loops in CraftStore and AlphaLoot. Hope this works.
Thank you & danke Baertram. |
Garkin, is there a way to get the itemlink from the oldSlot-variable?
|
Quote:
However, if you need an itemlink, lets use workaround. I did something like that in my changes to Lost Treasure addon. Register for callback "SlotAdded" and then add itemlink to the slot table (in LT I'm adding itemId). Lua Code:
|
Thats exactly what i need. Thank you again.
|
All times are GMT -6. The time now is 07:25 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI