Difference between revisions of "Rednet.open"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=rednet.open( side ) |args= side ("left","right","front","back","bottom","top") |api=rednet |addon=ComputerCraft |desc=Tells the computer that th...")
 
(More details.)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
{{Function
 
{{Function
|name=rednet.open( side )
+
|name=rednet.open
|args= side ("left","right","front","back","bottom","top")
+
|args=[[string (type)|string]] side ''("left" / "right" / "front" / "back" / "bottom" / "top")''
 
|api=rednet
 
|api=rednet
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Tells the computer that the side can be used for networking.  
+
|desc=Assuming a [[modem]] is attached to the specified side, rednet.open() tells the computer that side can be used for networking. The modem will be automatically configured to start listening on two channel numbers - one which has the same value as the computer's [[Os.getComputerID|ID]], and another which is used for detecting [[rednet.broadcast|rednet broadcasts]] (65535).<br><br>
 +
 
 +
See also: [[Modem.open|modem.open()]]
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Tells the computer that the side can be used for networking.  
+
|desc=Tells the computer that there is a modem to its left side that can be used for networking.  
|code=rednet.open( side )
+
|code=rednet.open( "left" )
 
}}
 
}}
 
}}
 
}}
 +
 +
{{RednetAPIFunctions}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 06:33, 6 June 2014


Grid Redstone.png  Function rednet.open
Assuming a modem is attached to the specified side, rednet.open() tells the computer that side can be used for networking. The modem will be automatically configured to start listening on two channel numbers - one which has the same value as the computer's ID, and another which is used for detecting rednet broadcasts (65535).

See also: modem.open()
Syntax rednet.open(string side ("left" / "right" / "front" / "back" / "bottom" / "top"))
Returns nil
Part of ComputerCraft
API rednet

Examples

Grid paper.png  Example
Tells the computer that there is a modem to its left side that can be used for networking.
Code
rednet.open( "left" )


Grid disk.png Rednet API Functions
rednet.open - rednet.close - rednet.send - rednet.broadcast - rednet.receive - rednet.isOpen - rednet.host - rednet.unhost - rednet.lookup