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.

disconnection delay
#1
Hello, I need to integrate a disconnection delay when all objects are FALSE, but in case it returns to TRUE for some reason, let the countdown stop. Then when it goes back to FALSE the account is reset again.

I did it for events but I don't know if it is the best option ...



Code:
Output = '1/1/10'

myobjects = grp.tag('EXTRACTION')

-------------------------------------
sum = 0
  for _, obj in ipairs(myobjects) do
    if obj.value then
        sum = sum+1
    end
  end
log(sum)

if sum > 0 then
grp.checkwrite(Output, true)
  else

--sleep(120)
grp.checkwrite(Output, false)
  end
Reply


Messages In This Thread
disconnection delay - by davidchispas - 14.12.2021, 15:19
RE: disconnection delay - by Daniel - 14.12.2021, 15:37

Forum Jump: