View this page on the Official ComputerCraft Wiki: http://computercraft.info/wiki/index.php?title=Rednet_(API)
The rednet API provides a capacity for Computers to communicate between themselves using a wireless modem.
To 'open' or 'close' a side to rednet, allowing or disallowing it to be used to commnuicate:
- rednet.open( "side" )
- rednet.close( "side" )
Also, to check if a side is open or closed:
To start running rednet (Warning, runs rednet but if rednet's already being run it will error out)
Functions for sending messages to other computers:
- rednet.send( receiverID, message ) -- Send to a specific computer
- rednet.broadcast( message ) -- Send to all computers
Functions for receiving messages:
- rednet.receive( timeout ) -- Returns: senderID, message -- timeout is the amount of time the program will wait for an 'answer', is optional.
You can also handle the "rednet_message" event to receive messages without calling receive(), the arguments are the same as the receive() return values.