16.05.2017, 16:25
For me the easiest solution is using Resident script. You can trigger resident script by some event.
When you switch off the resident script it stops working without finishing script.
Code:
grp.write('0/0/5', true)
os.sleep(10)
grp.write('0/0/5', false)
When you switch off the resident script it stops working without finishing script.