Difference between revisions of "Rednet (API)"
m (Resolve NeedsWork -> Infobox modem-use notice.) |
(Changes to isOpen - description was wrong, was missing link to already created page for it.) |
||
Line 32: | Line 32: | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Waits until it received a rednet message or <var>timeout</var> has passed. Leave args empty to wait for a message forever.</td></tr> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Waits until it received a rednet message or <var>timeout</var> has passed. Leave args empty to wait for a message forever.</td></tr> | ||
− | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">rednet.isOpen(side)</td> | + | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[rednet.isOpen]](side)</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns true if the wireless modem is open | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns true if the wireless modem is open.</td></tr> |
</table> | </table> | ||
Revision as of 02:07, 27 March 2013
Please Note As of ComputerCraft 1.5, the Rednet API is just a wrapper for modems and channels.
|
The Rednet API allows computers to communicate between themselves without using redstone wires. In order to send and receive data, a modem is required. The data is received immediately after sending it, but only by computers within a certain range. That range depends on the altitude of the sending computer increasing with higher altitudes to a max of 384.
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() | Broadcasts an empty rednet message. |
rednet.send(receiverID, message) | Sends a message to the computer using the opened sides. The receiver ID is the ID (number, not string) of the computer you're sending the message to. ID as nil will do the same as a broadcast. The message must be a string to send across rednet, if you are wanting to send a table see textutils.serialize |
rednet.broadcast(message) | Sends the message to ALL connected and open computers. |
rednet.receive(timeout) | Waits until it received a rednet message or timeout has passed. Leave args empty to wait for a message forever. |
rednet.isOpen(side) | Returns true if the wireless modem is open. |
Events
Event name | Description | Parameters |
---|---|---|
rednet_message | Fired when a rednet message is received (can be used as alternative for rednet.receive()) | senderId, message, distance |
History
Before the creation of the in-game wireless networking API, the term "Rednet" referred to a system created by one of the ComputerCraft users based on bundled cables from a popular Minecraft mod - RedPower. It also allowed communication between computers, but the data was transferred slowly - every bit was converted to redstone signal, that lasted about 0,1 seconds. On the release of ComputerCraft 1.3, the system became useless, as the wireless networking was officially implemented to the mod.