No, it's the item's itemLink then, and not only the name of the item.
To get the item's name from that link use the function here:
Code:
* GetItemLinkName(*string* _itemLink_)
** _Returns:_ *string* _itemName_
Use it like this then:
btw: Is it correct that your variable "bFound" is a global one?
If you use global variables please create one global array for your addon's namespace like this
and add your addon's variables to it then. Otherwise you might get in trouble if any other addon uses "bFound" too!
Code:
myAddonName.bFound = false
Lua Code:
RegisterForEvent(EVENT_LOOT_RECEIVED, XL.OnItemLooted)
function XL.OnItemLooted (numID, lootedBy, itemLinkStr, quantity, itemSound, lootType, self)
myAddonName.bFound = false
d (itemLinkStr)
local itemName = GetItemLinkName(itemLinkStr)
if itemName ~= nil and (string.find(itemName, "Needle") ~= nil) then myAddonName.bFound = true
end
-- Do something here
end