rednet.open

 Note: This function call requires a Modem peripheral to be attached to the computer. See Networking for more information.

rednet.open
Function
Syntax
rednet.open(
  • side : string
)

Returns nil
API rednet
Source CC:Tweaked (source)

Opens rednet on the modem attached to side.

 Note: Rednet is not secure against interception or spoofing. See Network security#Rednet for more information.

ExampleOpen the top modem.
Opens rednet on the top modem of the computer.
Code
<nowiki>
rednet.open("top")
    </nowiki>
Output Rednet events will now trigger on the top modem.
ExampleOpen all connected modems
This is a little trick using peripheral.find. It accepts a function as the second argument, which is called for each matching peripheral. By using rednet.open here, every connected modem is opened.
Code
<nowiki>
peripheral.find("modem", rednet.open)
    </nowiki>
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.