27.08.2021, 07:37
Create a resident script with sleep time set to 0 and set the script name to light scene
Then you can create an event script (1-bit object) which can be used to turn the scene on and off:
Code:
step = 10
delay = 0.2
addrs = { '32/1/15', '32/1/16', '32/1/17' }
for _, addr in ipairs(addrs) do
for value = 0, 100, step do
grp.write(addr, value, dt.scale)
os.sleep(delay)
end
end
for i = #addrs, 1, -1 do
addr = addrs[ i ]
for value = (100 - step), 0, -step do
grp.write(addr, value, dt.scale)
os.sleep(delay)
end
end
Then you can create an event script (1-bit object) which can be used to turn the scene on and off:
Code:
value = event.getvalue()
if value then
script.enable('light scene')
else
script.disable('light scene')
end