Jump to content




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


  • You cannot reply to this topic
5 replies to this topic

#1 fatboychummy

  • Members
  • 25 posts

Posted 16 October 2016 - 10: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 by fatboychummy, 16 October 2016 - 10:28 PM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 October 2016 - 10:42 PM

It returns nil if it times out.

#3 fatboychummy

  • Members
  • 25 posts

Posted 16 October 2016 - 11:00 PM

Okay, thanks!

#4 hbomb79

  • Members
  • 352 posts
  • LocationOrewa, New Zealand

Posted 17 October 2016 - 04: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.

#5 fatboychummy

  • Members
  • 25 posts

Posted 20 October 2016 - 12:47 AM

View PostHbomb_79, on 17 October 2016 - 04:09 AM, said:

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.

#6 hbomb79

  • Members
  • 352 posts
  • LocationOrewa, New Zealand

Posted 20 October 2016 - 01:21 AM

View Postfatboychummy, on 20 October 2016 - 12:47 AM, said:

View PostHbomb_79, on 17 October 2016 - 04:09 AM, said:

-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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users