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

Basics On Rednet?

Started by russjr08, 27 February 2012 - 12:43 AM
russjr08 #1
Posted 27 February 2012 - 01:43 AM
I've been using ComputerCraft with the latest TechnicPack and Tekkit, and me and my friend are trying to connect the computers using rednet. I've connected two computers using bundled cables (though I've tried regular alloy too).

I've done on computer one


rednet.open("back")
rednet.broadcast("Ohai!")

Then on computer two


rednet.open("right")
message = rednet.receive(20)
print(message)

I start the receive on computer 2 first and then broadcast.

But when I print the message, I get a 1. (And the broadcast returns true)

Please help!
Casper7526 #2
Posted 27 February 2012 - 01:45 AM
id, message = rednet.receive(20)
russjr08 #3
Posted 27 February 2012 - 01:53 AM
You're quick!! Thank you! I've noticed that it adds a "1" at the end. What is that for?

Edit: That's only when you run it from the lua interpreter.