12.10.2020, 14:53
(09.10.2020, 21:33)Erwin van der Zwart Wrote: Try this as event based on the TAG "cancello":
Code:if event.getvalue() == true then
previouspid = storage.get('PID:' .. _SCRIPTNAME)
storage.set('PID:' .. _SCRIPTNAME, os.getpid())
if previouspid then
os.kill(previouspid, signal.SIGKILL)
end
night = grp.getvalue('32/1/6')
if night == true then
grp.checkwrite('0/0/84', true)
os.sleep(600)
grp.checkwrite('0/0/84', false)
end
storage.delete('PID:' .. _SCRIPTNAME)
end
Thank you very much Erwin. Just one question: previouspid is a local variable? I can use the same variable name for other event script or shall I use other name in order to avoid problem?
Thanks.
Br