16.02.2016, 12:41
(16.02.2016, 11:22)admin Wrote: Here are 2 functions for getting OR / AND values for binary objects with the same tag. You can then use the result to write out the status.
Code:function tag_and(tag)
local objects, result
result = true
objects = grp.tag(tag)
for _, object in ipairs(objects) do
result = result and object.data
end
return result
end
function tag_or(tag)
local objects, result
result = false
objects = grp.tag(tag)
for _, object in ipairs(objects) do
result = result or object.data
end
return result
end
Thanks