Difference between revisions of "Wireless Modem"

From ComputerCraft Wiki
Jump to: navigation, search
(example details)
Line 7: Line 7:
  
 
== example details ==
 
== example details ==
place 2 computers (or turtles) and add to them the Modem (by placing on the side while being in sneaking mode - LShift)
+
* place 2 computers (or turtles) and add to them the Modem (by placing on the side while being in sneaking mode - LShift)
type "lua" on both  
+
* type "lua" on both  
then type "rednet.open (" side where's the modem ") on both
+
* then type "rednet.open (" side where's the modem ")" on both
check that the modems are redlighted a bit = turned on
+
* check that the modems are redlighted a bit = turned on
on the first one type "rednet.receive (60)" - 60 = time to listen in seconds, the computer will be frozen until receiving any message or runing out of time
+
* on the first one type "rednet.receive (60)" - 60 = time to listen in seconds, the computer will be frozen until receiving any message or runing out of time
on the second one type "rednet.broadcast ("hi all")" - "hi all" = message, returns "true"
+
* on the second one type "rednet.broadcast ("hi all")" - "hi all" = message, returns "true"
and now you will see that "hi all" on the first one (the number is computerID, then the message)
+
* and now you will see that "hi all" on the first one (the number is computerID, then the message)
  
 
for more help type "help rednet" or get it here: http://computercraft.info/wiki/index.php?title=REDNET
 
for more help type "help rednet" or get it here: http://computercraft.info/wiki/index.php?title=REDNET

Revision as of 21:17, 26 February 2012

Description

Modems are blocks, which can be used to wirelessly transfer data between computers and turtle, using "rednet" commands. To place a modem on a side of your computer, sneak and then click right (sneak usually = left Shift key)!

you can turn the modem on and off by typing in lua: "rednet.open ( side )" - turn on, "rednet.close ( side )" - turn off

example details

  • place 2 computers (or turtles) and add to them the Modem (by placing on the side while being in sneaking mode - LShift)
  • type "lua" on both
  • then type "rednet.open (" side where's the modem ")" on both
  • check that the modems are redlighted a bit = turned on
  • on the first one type "rednet.receive (60)" - 60 = time to listen in seconds, the computer will be frozen until receiving any message or runing out of time
  • on the second one type "rednet.broadcast ("hi all")" - "hi all" = message, returns "true"
  • and now you will see that "hi all" on the first one (the number is computerID, then the message)

for more help type "help rednet" or get it here: http://computercraft.info/wiki/index.php?title=REDNET