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.

Tag triggered script but only on value change
#1
Hello,

is it possible to trigger an event script based on tag objects but only if the value of that single object is changed?

for example, I have some objects with cyclic send and I want to trigger the script only when the value change

thank you
Reply
#2
Use this:
Code:
key = 'prev_value_' .. event.dstraw

value = event.getvalue()
prev = storage.get(key)

if value == prev then
  return
end

storage.set(key, value)

-- put script here
Reply
#3
Thank you, works like a charm
Reply


Forum Jump: