View Single Post
06-28-13, 04:24 PM   #6
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
You're better off using itemlinks and a function to get the position, links are more accurate.
Lua Code:
  1. local function GetBagPosition(itemLink)
  2.     for bag = 0, NUM_BAG_SLOTS do
  3.         for slot = 1, GetContainerNumSlots(bag) do
  4.             if(GetContainerItemLink(bag, slot) == itemLink) then
  5.                 return bag, slot
  6.             end
  7.         end
  8.     end
  9. end
  10.  
  11. -- Get bag position of the Hearthstone
  12. local _, itemLink = GetItemInfo(6948)
  13. local bag, slot = GetBagPosition(itemLink)

Last edited by p3lim : 06-28-13 at 04:29 PM.
  Reply With Quote