16.02.2022, 07:12
Event script that gets the target level and adjusts the output object in small steps. Adjust as needed:
Code:
output = '1/1/4'
step = 5
delay = 0.5
target = event.getvalue()
current = grp.getvalue(output)
if target == current then
return
end
while true do
if current < target then
current = math.min(current + step, target)
else
current = math.max(current - step, target)
end
grp.write(output, current)
-- stop when target is reached
if current == target then
return
end
os.sleep(delay)
-- stop when targed changed, another script is running
if grp.getvalue(event.dst) ~= target then
return
end
end