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.

Deactivate button
#2
Hi,

You could use couple of counter and timer to define time since last push like:

Code:
local pushcount = storage.get('pushcount', 0)
local timepush = os.time()
local timepushinit = storage.get('lastpush', 0)
delta = timepush - timepushinit

if delta > 60 then
pushcount = 0
storage.set('lastpush', timepush)
end

if pushcount == 0 then
 -- do something
elseif pushcount == 1 and delta > 20 then
 --do something
elseif pushcount == 2 and delta > 30 then
 -- ...
else
 -- do something
end

pushcount = pushcount+1
storage.set('pushcount', pushcount)
Reply


Messages In This Thread
Deactivate button - by XSPA2474KW - 08.06.2017, 09:50
RE: Deactivate button - by mlaudren - 08.06.2017, 10:28
RE: Deactivate button - by XSPA2474KW - 25.06.2017, 07:48
RE: Deactivate button - by mlaudren - 27.06.2017, 15:29
RE: Deactivate button - by XSPA2474KW - 29.06.2017, 05:26
RE: Deactivate button - by admin - 29.06.2017, 07:28
RE: Deactivate button - by XSPA2474KW - 02.07.2017, 13:50

Forum Jump: