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.

Need Help with Lua Script for Group Object Control
#4
Tanks for the tips... i tried to execute all the tips in the new script... but it's still not working Big Grin

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
    grp.write(myobject, true)

    -- Wait for 3 minutes
    os.sleep(threeMinutesInSeconds)

    -- Turn off the group object
    grp.write(myobject, false)
end
Reply


Messages In This Thread
RE: Need Help with Lua Script for Group Object Control - by josdegroot - 17.07.2023, 19:42

Forum Jump: