Hi all
Sorry for the delayed reply.
Thanks for the links and code chunk.
Here is the current code;
Lua Code:
local tip = CreateFrame("GameTooltip","Tooltip",nil,"GameTooltipTemplate")
local function isTradable(itemLocation)
local itemLink = C_Item.GetItemLink(itemLocation)
tip:SetOwner(UIParent, "ANCHOR_NONE")
tip:SetBagItem(itemLocation:GetBagAndSlot())
for i = 1,tip:NumLines() do
if(string.find(_G["TooltipTextLeft"..i]:GetText(), string.format(BIND_TRADE_TIME_REMAINING, ".*"))) then
return true
end
end
end
for bag = 0, 4 do
for slot = 0, GetContainerNumSlots(bag) do
local itemID = GetContainerItemID(bag, slot)
if itemID then
local _, itemLink = GetItemInfo(itemID)
itemLocation = ItemLocation:CreateFromBagAndSlot(bag, slot)
if isTradable(itemLocation) then
print("found",itemLink,isTradable(itemLocation))
end
end
end
end
This works perfectly.
What I am wondering is I also want to be able to idently those items that can be sold back to the venror for a full refund.
The string I have to look for is REFUND_TIME_REMAINING yet when I try to find the string I get no matches.
Is it possible to search for either or both of the strings in the same loop?