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

Rednet receiving data (Tekkit Classic)

Started by mark0099, 04 June 2014 - 07:07 PM
mark0099 #1
Posted 04 June 2014 - 09:07 PM
I am playing on a server and I am testing out rednet for the first time, I want to be able to set a password door and have it send wirelessly to a computer in my base.
I am not sure on how to send the data though, I want to have the label of the computer that is password protecting the door and the password next to each one. how do I do this?

So basically I want to have a computer in my base send out a signal to password computers and for the computers to send their password back, how do I do it?
MKlegoman357 #2
Posted 04 June 2014 - 09:43 PM
You would use rednet.send to send a message from one computer to another and rednet.receive to receive the message.

Sending computer:

rednet.open("enter modem side here") --// Open the modem

rednet.send(10, "Message!") --// Send a message "Message!" to computer with ID 10

Receiving computer:

rednet.open("enter modem side here")

local id, message = rednet.receive()

print("I got a message from computer with ID: ", id)
print("The message says: ", message)
Edited on 04 June 2014 - 07:43 PM
mark0099 #3
Posted 04 June 2014 - 09:51 PM
Will that send to all computers or just one?
theoriginalbit #4
Posted 05 June 2014 - 02:42 AM
no, as shown on the wiki in the Rednet API there are two functions to use in order to transmit a message; rednet.send and rednet.broadcast

Now in the newer versions of ComputerCraft they definitely don't work in the same way described on the wiki (i.e. rednet send does send to all computers within range) however since you're on Tekkit Classic and thus have a really old version of ComputerCraft, you do not need to worry about this new limitation.