Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/15/14, 01:42 AM   #1
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
Question in regards to string.lower

Code:
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:
_, _, _, itemId = ZO_LinkHandler_ParseLink( objectName ) --name, color, type, id, +19 other attributes
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.
Code:
:hFFFFFF:item:1187:1:13:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:hclear waterh
I fixed it by making a global variable. However, for my sanity does anyone know why that's happening?
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Question in regards to string.lower


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off