This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
fatboychummy's profile picture

What happens when rednet.recieve(_,TIME) times out?

Started by fatboychummy, 16 October 2016 - 09:26 PM
fatboychummy #1
Posted 16 October 2016 - 11:26 PM
like, the values for id, message, and protocol?
Do they get assigned to nil? Or are they assigned as the last received value?


id, mes, prt = rednet.receive(_,10)
if id == num then
  blablabla
else
  blablabla
end
Edited on 16 October 2016 - 09:28 PM
Lyqyd #2
Posted 16 October 2016 - 11:42 PM
It returns nil if it times out.
fatboychummy #3
Posted 17 October 2016 - 12:00 AM
Okay, thanks!
hbomb79 #4
Posted 17 October 2016 - 05:09 AM
You should always check the documentation before asking a question. In this case, the documentation (found by simply googling 'rednet receive computercraft') tells you this.
fatboychummy #5
Posted 20 October 2016 - 01:47 AM
You should always check the documentation before asking a question. In this case, the documentation (found by simply googling 'rednet receive computercraft') tells you this.
Oh, I did look at that, just not well enough I suppose. I noticed it after doing a page search for nil though.
hbomb79 #6
Posted 20 October 2016 - 02:21 AM
-snip-
Oh, I did look at that, just not well enough I suppose. I noticed it after doing a page search for nil though.

No problem at all. It is generally easier and quicker for the poster to check rather than waiting for an answer.