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.

Cancel the saved command line after the os.sleep() command
#1
Hi guys ! I am having a problem, and want to solve it. I have the following code:
--------------------------------------
value = event.getvalue()
if value==true then
  os.sleep(60) --1p
  grp.write('6/1/18',false)
end
--------------------------------------
When I enable the value 6/1/18 it runs 60 seconds then 6/1/18==false. In some cases I want to be on 6/1/18=true, then on the 50th second I'm 6/1/18==false, on the 55th I'm 6/1/18=true, and I want it = =true forever. But after 5 seconds, it turned off 6/1/18=false(automatically), because the initial command it saved for 1 minute was =false . So I want when I activate it, it only saves the last command line, not the previous command lines. For example, I wrote the following:
-------------------------------------
value = event.getvalue()
if value==true then
  os.sleep(60) --1p
  grp.write('6/1/18',false)
end
break;
---------------------------------------
Is it right?

Thank so much ! everyone Smile
Reply


Messages In This Thread
Cancel the saved command line after the os.sleep() command - by phongvucba - 10.08.2022, 10:29

Forum Jump: