13.09.2023, 14:16
You can add multiple elseif statements. Just make sure that hour checks are in an ascending order.
Code:
value = event.getvalue()
if value then
hour = os.date('*t').hour
-- 0:00 - 7:59
if hour <= 7 then
out = 10
-- 8:00 - 16:59
elseif hour <= 16 then
out = 70
-- 17:00 - 21:59
elseif hour <= 21 then
out = 30
-- 22:00 - 23:59
else
out = 10
end
else
out = 0
end
grp.checkwrite('1/4/30', out)