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.

multiple identical scripts
#7
You can use tables for this. If event value is 1 then value of 1/1/2 will be written to 1/1/1, if event value is 2 then value of 1/1/4 will be written to 1/1/3. For all other event values nothing will happen.

Code:
dstaddrs = { '1/1/1', '1/1/3' }
valaddrs = { '1/1/2', '1/1/4' }

index = event.getvalue()
dstaddr = dstaddrs[ index ]

if dstaddr then
  value = grp.getvalue(valaddrs[ index ])
  grp.write(dstaddr, value)
end
Reply


Messages In This Thread
multiple identical scripts - by davidchispas - 19.02.2021, 09:01
RE: multiple identical scripts - by Daniel - 19.02.2021, 10:01
RE: multiple identical scripts - by admin - 19.02.2021, 10:05
RE: multiple identical scripts - by admin - 10.11.2022, 06:37
RE: multiple identical scripts - by admin - 10.11.2022, 12:49

Forum Jump: