Difference between revisions of "Rednet (API)"
From ComputerCraft Wiki
| Line 1: | Line 1: | ||
The rednet API provides a simple computer networking model over RedPower bundled cables. | The rednet API provides a simple computer networking model over RedPower bundled cables. | ||
| − | + | {| border="1" cellpadding="2" cellspacing="0" | |
| − | + | !style="background:#EEE" width="200px"|Method name | |
| − | *rednet.open( side ) | + | !style="background:#EEE" width="*"|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. | ||
[[Category:APIs]] | [[Category:APIs]] | ||
Revision as of 05:43, 31 January 2012
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.