Difference between revisions of "Rednet.receive"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=rednet.receive( timeout ) |args=A number representing the seconds to wait or leave empty to wait unlimited |returns=a tupel where the first valu...")
 
m (Fixing typo)
Line 3: Line 3:
 
|name=rednet.receive( timeout )
 
|name=rednet.receive( timeout )
 
|args=A number representing the seconds to wait or leave empty to wait unlimited
 
|args=A number representing the seconds to wait or leave empty to wait unlimited
|returns=a tupel where the first value is the sending computers id and the second the message string
+
|returns=a tuple where the first value is the sending computers id and the second the message string
 
|api=rednet
 
|api=rednet
 
|addon=ComputerCraft
 
|addon=ComputerCraft

Revision as of 14:27, 16 March 2012


Grid Redstone.png  Function rednet.receive( timeout )
Waits till timeout or another computer send a message to this computer. (see rednet.broadcast( message ) and rednet.send( receiverID, message ). To get the id from a computer see os.computerID()
Syntax rednet.receive( timeout )(A number representing the seconds to wait or leave empty to wait unlimited)
Returns a tuple where the first value is the sending computers id and the second the message string
Part of ComputerCraft
API rednet

Examples

Grid paper.png  Example
waits unlimited till someone sends a message to this computer and displays it
Code
senderId, message = rednet.receive()term.write(message)