18.07.2023, 19:27
Thanks for the reply!
This one is working
This one is working
Code:
-- Define the group object
local myobject = grp.find('0/0/21')
-- Define the time duration in seconds
local fiveMinutesInSeconds = 5 * 60
local threeMinutesInSeconds = 3 * 60
-- Check the last update time of the group object
local lastUpdateTime = myobject.updatetime
-- Check if the group object has not been updated for at least 5 minutes
if os.time() - lastUpdateTime >= fiveMinutesInSeconds then
-- Turn on the group object
myobject:write(true)
-- Wait for 3 minutes
os.sleep(threeMinutesInSeconds)
-- Turn off the group object
myobject:write(false)
end