Hi there! I've been trying to get an icon address from a looted item using GetLootInfo() and compare the address to one I've specifically supplied as a variable for comparison. The full version of the code is attached, but this is the problem area:
Code:
local lootIndex = GetNumLootItems()
print("function call successful")
if (lootIndex == 1) then
local lootInfo = GetLootInfo()
local fish1 = "Interface\\ICONS\\INV_misc_fish_06"
local fish2 = "Interface\\ICONS\\INV_misc_fish_02"
local fish3 = "Interface\\ICONS\\INV_misc_fish_19"
print(lootInfo)
--[[print("lootInfo[1] "..lootInfo[1])
print("lootInfo[texture] "..lootInfo[texture])
print("lootInfo.texture "..lootInfo.texture)]]
print("testing, image address should be above")
if(lootInfo == fish1) then
print("success!")
elseif(lootInfo == fish2) then
print("success!")
elseif(lootInfo == fish3) then
print("success!")
end
end
I've been sitting in Moonglade fishing, so those are the icons I'm comparing against. It enters the function successfully, and prints out "table:" and then when looks to be a memory address, where I keep hoping the image path will be. I thought perhaps there was some issue with string conversion or something (as the API indicates it SHOULD be a string) which is why I was testing it against the fish paths, in case instead of an actual path it might be storing a pointer to the icon or something to that effect.
Since it keeps showing a table value I've tried a variety of ways to access the value that I am expecting -- I've left most of these attempts in but commented out so you'd be able to see what I'd tried already. (lootInfo["texture"] has also been tried and didn't work, though I hadn't really expected that one to.)
My guess is that I'm not getting the right value from GetLootInfo() since I'm new to Lua. Any suggestions would be appreciated.