Thank you .. but it doesn't go thru if...
It is not considered as "FRAME and FRAME" but "string with spaces" if you know what i mean.
i ended up doing this... this seems to be working
lua Code:
local keywords = {
["and"] = "and",
["or"] = "or",
}
function f(condition, callback)
condition_table = {}
condition_table['and'] = {}
condition_table['or'] = {}
condition:gsub(
'[_%w]+',
function(word)
-- return keywords[word] or string.format("_G[%q]", word)
-- text.keywords[word] = string.format('_G[%q]', word)
if keywords[word] then
next_keyword = keywords[word]
else
if next_keyword then
table.insert(condition_table[next_keyword], word)
else
table.insert(condition_table, word)
end
end
end
)
for k, v in ipairs(condition_table) do
c = _G[v]
end
for k, v in ipairs(condition_table['and']) do
c = c and _G[v]
end
for k, v in ipairs(condition_table['or']) do
c = c or _G[v]
end
if(c) then
callback()
end
end
I'm faaaaar from lua developer.. I'm struggling a lot... so if anyone have better solution I'm game