Hello, I have this code in my addon:
Code:
RegisterForEvent(EVENT_LOOT_RECEIVED, XL.OnItemLooted)
function XL.OnItemLooted (numID, lootedBy, itemName, quantity, itemSound, lootType, self)
bFound = false
d (itemName)
if (string.find(itemName, "Needle") ~= nil) then bFound = true
end
-- Do something here
end
The above never detects the presence of the "Needle" string in the itemName. Why? The code seems correct.
1) I verified that the IF works by pre-injecting my own strings into itemName.
2) The d(itemName) displays correctly formed item link in chat.
How do I convert the itemName link to searchable string?
Thanks!