View Single Post
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