Hi Admin,
I figured it out. I can use copas to add a new thread, then put it to sleep until its needed.
then when I need to activate it I use
Thanks,
Roger
I figured it out. I can use copas to add a new thread, then put it to sleep until its needed.
Code:
co = copas.addthread(function()
while true do
copas.sleep(2) -- wait 2 seconds
alert("send some command")
copas.sleep(-1) -- put the thread to sleep until wakeup is called
end
end)
then when I need to activate it I use
Code:
copas.wakeup(co)
Thanks,
Roger