Ok, my variables are updating correctly in the tables now that I've gone through and made the changes that needed to be changed. I think I have a better grasp on the syntax for referring to table entries now.
I still have a problem with my main harvest function. The function relies on the value of the herb variable being set to true (which it is doing correctly) and that the hasbalance variable is true (which it is doing correctly).
I know that the function as written is not getting any values passed to it because if it were they would be in the function declaration line inside of my parenthesis.
My thought is that I need to pass the variable hasbalance from the balance table during the function declaration, is that correct or will my function be able to pull the values of hasbalance and the toharvest table without needing to be passed?
Here is the function as it is written now:
function harvest()
for k,v in ipairs(toharvest) do
if v==true and balance["hasbalance"]==true then
send("harvest "..(k))
else
cecho("CANNOT HARVEST")
end
end
end
Thanks to Sohl for helping me to understand that I can't use ipairs for this instance because the values that I have aren't indexed as numbers they are indexed as strings. I also didn't realize that in Lua you dont use == to evaluate a boolean against true, the variable automatically assesses against true without the ==.
I also cut out the else statement that had the CECHO because it evaluated against all of the values of the table and would return "CANNOT HARVEST" for every false value, which I didn't realize until I saw it happen, but it makes sense sice it iterates through ever instance of the table.
Fixed up code:
function harvest()
for k,v in pairs(toharvest) do
if v and balance["hasbalance"] then
send("harvest "..(k))
end
end