View Single Post
06/22/15, 01:06 PM   #6
ahmetertem
AddOn Author - Click to view addons
Join Date: Jun 2015
Posts: 7
Originally Posted by Ayantir View Post
Please avoid

Lua Code:
  1. local bagSlots = GetBagSize(bagId) -1
  2. for slotIndex = 0, bagSlots do
  3.     local itemType = GetItemType(bagId, slotIndex)

to itarate bags.

Use :

Lua Code:
  1. local bagCache = SHARED_INVENTORY:GenerateFullSlotData(nil, BAG_BACKPACK)
  2. for slotId, data in pairs(bagCache) do

instead.

1st, the first snipped don't really work work Guild Bank.
2nd, sometimes , it don't work neither in bag. (even it's more rare).

And most of all, please consider that slotIndex is data.slotIndex and not in the key.

Great informations. Thank you very much explanation as well.
  Reply With Quote