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.

Multi OR port
#4
What script is more effective and takes less time and less resources to execute? Something like this:

Quote:value = grp.getvalue('1address')
value2 = grp.getvalue('2address)
value3 = grp.getvalue('3address')

output = 'outputaddress'

if(value or value2 or value3 == true) then
  grp.write(output, true)
else 
  grp.write(output, false)
end
 Or this one:

Quote:tagname = 'OR_LOGIC'
output = 'output_address'
for i, object in ipairs(grp.tag(tagname)) do
if object.data then
grp.checkwrite(output, true, 1)
return
end
end
grp.checkwrite(output, false, 1)

I have many lights and many rooms and if I turn on ALL lights at the same time there are a lot of scripts executing at once, so I need the most perfomance-effective solution.
Reply


Messages In This Thread
Multi OR port - by fabiorusco - 21.01.2019, 15:38
RE: Multi OR port - by Erwin van der Zwart - 21.01.2019, 21:51
RE: Multi OR port - by Daniel - 22.01.2019, 08:31
RE: Multi OR port - by MantasJ - 24.01.2019, 14:53
RE: Multi OR port - by Daniel - 24.01.2019, 15:00
RE: Multi OR port - by MantasJ - 24.01.2019, 15:55
RE: Multi OR port - by Daniel - 24.01.2019, 16:07
RE: Multi OR port - by Erwin van der Zwart - 24.01.2019, 16:49

Forum Jump: