This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Central statuses
#2
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
Reply


Messages In This Thread
Central statuses - by buuuudzik - 16.02.2016, 08:54
RE: Central statuses - by admin - 16.02.2016, 11:22
RE: Central statuses - by buuuudzik - 16.02.2016, 12:41
RE: Central statuses - by Pawel - 18.02.2016, 08:21
RE: Central statuses - by buuuudzik - 18.02.2016, 10:12

Forum Jump: