Difference between revisions of "Wireless Modem"
From ComputerCraft Wiki
(→Example) |
|||
Line 11: | Line 11: | ||
* Place 2 consoles and add modems to them by clicking the right mouse button while sneaking. | * Place 2 consoles and add modems to them by clicking the right mouse button while sneaking. | ||
* Access them, and start Lua. | * Access them, and start Lua. | ||
− | * Once Lua has started, type "rednet.open (<relative location to modem, e.g. left, right>)" on both consoles. | + | * Once Lua has started, type "rednet.open ("<relative location to modem, e.g. left, right>")" on both consoles. |
* Check if there exists a connection: a dim, red light should be found on the modem. | * Check if there exists a connection: a dim, red light should be found on the modem. | ||
* Type on one console "rednet.receive (60)". This will make the console freeze for 60 seconds, or until it has received a signal from the other console. | * Type on one console "rednet.receive (60)". This will make the console freeze for 60 seconds, or until it has received a signal from the other console. |
Revision as of 04:50, 22 March 2012
Description
Modems are blocks which can be used to wirelessly transfer data between consoles and turtles, using "rednet" commands. To place a modem on a side of your console, click on the console with the right mouse button while sneaking (with standard settings: holding the left shift button).
It is also possible to turn the modem on and off by typing "rednet.open ( side )" to open and "rednet.close ( side )" to close.
Modems can send messages to other modems located up to 64 metres away, or 17 metres during a thunderstorm.[1]
Example
- Place 2 consoles and add modems to them by clicking the right mouse button while sneaking.
- Access them, and start Lua.
- Once Lua has started, type "rednet.open ("<relative location to modem, e.g. left, right>")" on both consoles.
- Check if there exists a connection: a dim, red light should be found on the modem.
- Type on one console "rednet.receive (60)". This will make the console freeze for 60 seconds, or until it has received a signal from the other console.
- Now, type "rednet.broadcast ('<your message>')" on the other console. This should send your message to all consoles connected.
- Opening the first console should show the message written on the second console.