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.

Blocking delay
#1
Hi, 

I want to write macro for AV control in lua library so an object can call the function and do a group of things.
when i switch the tv on from off i need to wait 6 sec (time it takes for the tv to start up) before i send it another command 
i don't want to have multiple scripts running so don't want to use os.sleep() what is the best way to do this blocking delay?

Code:
function tv_on()
-- get the state of the tv
local tv_state = get_tv_state() --  returns bool

if tv_state then
-- set to correct input
end

if not tv_state then
-- wait 6 sec then set to correct input
end

end
Reply


Messages In This Thread
Blocking delay - by benanderson_475 - 24.04.2020, 22:09
RE: Blocking delay - by AlexLV - 25.04.2020, 04:39
RE: Blocking delay - by benanderson_475 - 29.04.2020, 21:35
RE: Blocking delay - by admin - 25.04.2020, 07:38
RE: Blocking delay - by admin - 30.04.2020, 04:38
RE: Blocking delay - by AlexLV - 30.04.2020, 16:00

Forum Jump: