Posted 05 December 2012 - 08:37 AM
How do you check if the rednet receive timed out. I have it set up properly to get messages but I can't find how to find out when it times out so I can do something.
I know that, I was just wondering how you check when it has timed out. But I think I got it as the message is returned as nothingIf you use rednet.receive() with no arguments, it will continue forever until it receives a rednet message of any kind. Using rednet.receive(timeout) will allow you to use a specific timeout period. Say… (5) seconds.
local id, msg, dist = rednet.receive(5)
if not msg then
print("message not received")
else
--do other stuff
end