14.12.2021, 15:19
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 ...
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