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.

Get variable change time
#2
Hi,

Try this:
Code:
value = event.getvalue()
if value == true then
  storage.set(_SCRIPTNAME, os.time())
else
  lastupdatetime = storage.get(_SCRIPTNAME)
  if lastupdatetime then
    difference = os.time() - lastupdatetime
    log(difference)
  end
end
BR,

Erwin
Reply


Messages In This Thread
Get variable change time - by MantasJ - 20.10.2019, 17:52
RE: Get variable change time - by Erwin van der Zwart - 20.10.2019, 18:07
RE: Get variable change time - by MantasJ - 22.10.2019, 11:51

Forum Jump: