ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Is it possible to get quantity number from/for EVENT_SINGLE_SLOT_UPDATE? (https://www.esoui.com/forums/showthread.php?t=1718)

lyravega 06/03/14 08:02 AM

Is it possible to get quantity number from/for EVENT_SINGLE_SLOT_UPDATE?
 
This event also fires when you loot an item. I am trying to move away from EVENT_LOOT_RECEIVED to this event, as it offers more flexibility and is easier to access some stuff. However, quantity number eludes me. Any way I can get the quantity numbers when you loot something, with this event?

Xrystal 06/03/14 08:25 AM

Hmm,
I use both events but don't have access to my code while at work to see where I get the quantity from, not that I actually use it. I'll take a look when I get home tonight and will let you know where I get that value from.

Garkin 06/03/14 08:27 AM

Quote:

Originally Posted by lyravega (Post 9020)
This event also fires when you loot an item. I am trying to move away from EVENT_LOOT_RECEIVED to this event, as it offers more flexibility and is easier to access some stuff. However, quantity number eludes me. Any way I can get the quantity numbers when you loot something, with this event?

Lua Code:
  1. EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_INVENTORY_SINGLE_SLOT_UPDATE,
  2.    function(eventCode, bagIndex, slotIndex, isNewItem, itemSoundCategory, updateReason)
  3.       --you can filter out some unwanted updates, for example:
  4.       if isNewItem == false then return end
  5.       if updateReason == INVENTORY_UPDATE_REASON_DURABILITY_CHANGE then return end
  6.       if bagIndex ~= BAG_BACKPACK then return end
  7.  
  8.       local icon, stackCount, sellPrice = GetItemInfo(bagIndex, slotIndex)
  9.       d(zo_strformat("Quantity: <<1>>", stackCount))
  10.    end)

lyravega 06/03/14 09:26 AM

Garkin, doesn't that return the total sum of that item in your bag? I was asking for a way to get the "quantity looted" number, rather than the total quantity (just the change in other words), apologies if I got misunderstood (or you were giving me the correct answer, and I misunderstood :P)

Xrystal, thanks. I'd appreciate it.

Garkin 06/03/14 09:44 AM

Quote:

Originally Posted by lyravega (Post 9028)
Garkin, doesn't that return the total sum of that item in your bag? I was asking for a way to get the "quantity looted" number, rather than the total quantity (just the change in other words), apologies if I got misunderstood (or you were giving me the correct answer, and I misunderstood :P)

Xrystal, thanks. I'd appreciate it.

Ah, sorry I misunderstood. There is no way to get quantity looted from this event unless you keep track of what you have in bag and then count current stackCount - previous stackCount.

lyravega 06/03/14 10:27 AM

Hmm, I understand.

Wobin 06/03/14 09:33 PM

Any reason you can't use both events? The loot one to get the quantity, then match it to the slot update one with a link for the rest of your processing

Xrystal 06/04/14 04:21 PM

Quote:

Originally Posted by lyravega (Post 9028)
Garkin, doesn't that return the total sum of that item in your bag? I was asking for a way to get the "quantity looted" number, rather than the total quantity (just the change in other words), apologies if I got misunderstood (or you were giving me the correct answer, and I misunderstood :P)

Xrystal, thanks. I'd appreciate it.

Okay, sorry for not replying yesterday but I totally forgot I said I would check.... seriously I stopped being blonde at 5 years old.

I use 2 events for gathering and of course the interaction test in the onupdate function.

EVENT_INVENTORY_SINGLE_SLOT_UPDATE
- I use the slot update routine to get the item details received
EVENT_LOOT_RECEIVED
- I use loot received to track who received what item and how many

redgabber 05/02/18 09:11 AM

HI

Any fix for this ?

i have the same prb

[edit] solved here : http://www.esoui.com/forums/showthre...4576#post34576


All times are GMT -6. The time now is 09:58 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI