hi! i'm currently fiddling with a tooltip scan to cache items in my inventory that give artifact power on use. the function checks the tooltip and then pulls the container id and rewarded amount listed in the tooltip into a function to create a button that can be clicked to use the item.
Lua Code:
for i = 0, 4 do
for j = 1, GetContainerNumSlots(i) do
local item = GetContainerItemLink(i, j)
local id = GetContainerItemID(i, j)
if id then
tooltip:SetHyperlink(item)
local two = _G[tooltip:GetName()..'TextLeft2']
if two and two:GetText() then
if strmatch(two:GetText(), 'Artifact Power') then
local four = _G[tooltip:GetName()..'TextLeft4']:GetText()
local ap = string.match(four, '%d+')
if ap then show(id, ap) break end
end
end
end
end
end
this works fine, UNTIL i create two separate stacks of conjured items and place them side-by-side in the container (ie. by pressing auto-sort). this will then break tooltip line returns for all items after the first instance of the duplicated item. adding
will just return nil beyond that first duplicated item.
any idea what's causing this?