Rednet (API)

From ComputerCraft Wiki
Revision as of 05:43, 31 January 2012 by Kaleb702 (Talk | contribs)

Jump to: navigation, search

The rednet API provides a simple computer networking model over RedPower bundled cables.

Method name Description
rednet.open( side ) Tells the computer that the side can be used for networking.
rednet.close( side ) Tells the computer that the side can no longer be used for networking.
rednet.announce() <no description given>
rednet.send( receiverID, message ) Sends a message to the computer using the opened sides.
rednet.broadcast( message ) Sends the message to ALL computers.
rednet.receive( timeout ) Receives packets. Usage: senderID, message = rednet.receive(5) and the like. It sends the ID of the sender, and the message.

You can also handle the "rednet_message" event to receive messages without calling receive(), the arguments are the same as the receive() return values.