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

Problem with my RedNet Tool.

Started by tommyroyall, 02 March 2012 - 12:38 AM
tommyroyall #1
Posted 02 March 2012 - 01:39 AM
Hey guys. I was making a small networking tool, and I can't manage to get the recieving computer to get the message. Whenever the server host sends any sort of signal, the reciever just breaks on to the next line of code and never displays the ID or data of the host.

Download: http://www.mediafire.com/?4dtd18mxdx0mms1

Thanks :unsure:/>/>
- Sledger721

The bug is on the function starting at line 56 I believe.
Advert #2
Posted 02 March 2012 - 01:54 AM
Some tips:
  • Indent your code; this makes it much more readable.
  • sleep() causes your computer to ignore any events that occur while it is sleeping
  • You're discarding the results of rednet.recieve; I think this is what your problem is.
  • Use local variables where you can; using globals everywhere is bad practice, and can cause conflicts.


Note: This is just from a quick glance at your code, I didn't test it.
tommyroyall #3
Posted 02 March 2012 - 02:10 AM
K advert, and I know. I just sorta whipped this up, not a finished product, but what exactly would I need to change.
Advert #4
Posted 02 March 2012 - 02:12 AM
You'd need to save the results of rednet.receive somewhere, then do stuff with it.
tommyroyall #5
Posted 02 March 2012 - 02:21 AM
K, thx. Ill try that.