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

Issues with Rednet.

Started by OODintheROOM, 28 November 2012 - 11:27 PM
OODintheROOM #1
Posted 29 November 2012 - 12:27 AM
so i have looked at every tutorial i can find on how to do this and im coming up blank.
Im trying to send a message from my workshop to my computer room. (its less than 50 blocks)
The sending computer's (id13)code is:

rednet.open("back")
rednet.send(9, "hello")


and the receiving computer's (id9)code is:

rednet.open("back")
rednet.receive()
print(message)

when i run the receiving code it locks the screen (good i think?)
and when i run the sending code it skips a line and the cursor blinks(like normal)
and when i run back to the receiving computer it has also skipped a line and the cursor is blinking aswell.

What am i doing wrong?
in the end im hoping to program the sending computer to tell my receiving computer if a redstone signal is off or on.
also, sorry for the grammar. is 4AM, gimme a break…
remiX #2
Posted 29 November 2012 - 12:33 AM
Make
rednet.receive()
into
senderID, message, distance = rednet.receive()

rednet.receive() has returns 3 values, the ID of which the message is received from, the message and the distanced between the PC's.
OODintheROOM #3
Posted 29 November 2012 - 08:23 AM
Make
rednet.receive()
into
senderID, message, distance = rednet.receive()

rednet.receive() has returns 3 values, the ID of which the message is received from, the message and the distanced between the PC's.
Ok, it works. thanks! :D/>