13.08.2022, 06:22
(This post was last modified: 13.08.2022, 06:28 by phongvucba.)
Hello Daniel !
I tried killing PID, but it gives error, do you know what is the error?
"User script:6: bad argument #1 to 'kill' (number expected, got nil)
stack traceback:
[C]: in function 'kill'
User script:6: in main chunk"
------------------event 6/1/18----
-- object mapped to this event must have its data type set
value = event.getvalue()
pid = os.getpid()
oldpid = storage.get('MyPID')
if oldpid ~= pid then
os.kill(oldpid, signal.SIGKILL)
os.sleep(60)
grp.write('6/1/18',false)
storage.set('MyPID', pid)
end
---------------------------------
Am I writing like this? I want that every 60 seconds without effect, it will be ==false. And if there is an impact, for example, the 55th second, if it has an effect, it will reset the time to be counted as 60 seconds later ==false
Thank so much!
I tried killing PID, but it gives error, do you know what is the error?
"User script:6: bad argument #1 to 'kill' (number expected, got nil)
stack traceback:
[C]: in function 'kill'
User script:6: in main chunk"
------------------event 6/1/18----
-- object mapped to this event must have its data type set
value = event.getvalue()
pid = os.getpid()
oldpid = storage.get('MyPID')
if oldpid ~= pid then
os.kill(oldpid, signal.SIGKILL)
os.sleep(60)
grp.write('6/1/18',false)
storage.set('MyPID', pid)
end
---------------------------------
Am I writing like this? I want that every 60 seconds without effect, it will be ==false. And if there is an impact, for example, the 55th second, if it has an effect, it will reset the time to be counted as 60 seconds later ==false
Thank so much!