LogicMachine Forum
Tag triggered script but only on value change - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Tag triggered script but only on value change (/showthread.php?tid=6456)



Tag triggered script but only on value change - Ceros2112 - 09.06.2026

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


RE: Tag triggered script but only on value change - admin - 09.06.2026

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



RE: Tag triggered script but only on value change - Ceros2112 - 09.06.2026

Thank you, works like a charm