Thread Tools Display Modes
06/03/14, 08:02 AM   #1
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
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?
  Reply With Quote
06/03/14, 08:25 AM   #2
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
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.
  Reply With Quote
06/03/14, 08:27 AM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by lyravega View Post
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)

Last edited by Garkin : 06/03/14 at 08:29 AM.
  Reply With Quote
06/03/14, 09:26 AM   #4
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
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.
  Reply With Quote
06/03/14, 09:44 AM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by lyravega View Post
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.
  Reply With Quote
06/03/14, 10:27 AM   #6
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
Hmm, I understand.
  Reply With Quote
06/03/14, 09:33 PM   #7
Wobin
 
Wobin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 78
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
  Reply With Quote
06/04/14, 04:21 PM   #8
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by lyravega View Post
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
  Reply With Quote
05/02/18, 09:11 AM   #9
redgabber
AddOn Author - Click to view addons
Join Date: May 2017
Posts: 6
HI

Any fix for this ?

i have the same prb

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

Last edited by redgabber : 05/02/18 at 09:44 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Is it possible to get quantity number from/for EVENT_SINGLE_SLOT_UPDATE?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off