10.08.2022, 10:29
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
--------------------------------------
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