Logic Machine Forum
disconnection delay - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: disconnection delay (/showthread.php?tid=3747)



disconnection delay - davidchispas - 14.12.2021

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



RE: disconnection delay - Daniel - 14.12.2021

See how delay was done here
https://forum.logicmachine.net/showthread.php?tid=3538&pid=22863#pid22863