function Harvest.IsValidBottle(name)
for k, v in pairs(Harvest.bottle) do
d("v name :" .. v)
d("name :" .. name)
if v == name then
return true
end
end
return false
end
I though the above function was working perfectly yesterday. However, I reverted changes to stick with the original authors syntax.
The entire function:
Warning: Spoiler
Code:
function Harvest.OnLootReceived( eventCode, receivedBy, objectName, stackCount, soundCategory, lootType, lootedBySelf )
if not Harvest.PlayetInteracting or not lootedBySelf then
if Harvest.settings.debug then
if not Harvest.PlayetInteracting then
d("Not Harvesting")
end
if not lootedBySelf then
d("Not Looted by self")
end
end
return
end
local zone, x, y = Harvest.GetLocation()
local itemId
_, _, _, itemId = ZO_LinkHandler_ParseLink( objectName ) --name, color, type, id, +19 other attributes
itemId = tonumber( itemId )
if Harvest.settings.debug then
d("OnLootReceived ItemNumber:" .. itemId)
d("OnLootReceived ItemName" .. objectName)
end
local profession = Harvest.GetProfessionType(itemId, objectName)
if (profession < 1) then
if Harvest.settings.debug then
d("Valid profession information Not found!")
end
return
end
Harvest.saveData( zone, x, y, profession, objectName, itemID )
Harvest.RefreshPins( profession )
end
He uses that to do something and I don't quite get. The function is on the wiki but no explanation as to what it does. Whatever it's doing it's preventing the routine from comparing the names. So I changed the Boolean routine to this thinking it would be enough.
Code:
function Harvest.IsValidBottle(name)
for k, v in pairs(Harvest.bottle) do
d("v name :" .. v)
d("name :" .. string.lower(name))
if v == string.lower(name) then
return true
end
end
return false
end
When I do that then the debug routine returns this.