Difference between revisions of "Modem.isOpen"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) |
MKlegoman357 (Talk | contribs) |
||
| Line 11: | Line 11: | ||
|code= local modem = [[peripheral.wrap]]("top") | |code= local modem = [[peripheral.wrap]]("top") | ||
| − | if modem.isOpen(5) then | + | if '''modem.isOpen(5)''' then |
print("The computer is listening on channel 5.") | print("The computer is listening on channel 5.") | ||
else | else | ||
Latest revision as of 17:48, 10 April 2014
| Checks whether or not a certain channel is open. | |
| Syntax | modem.isOpen(number channel) |
| Returns | boolean is channel open? |
| Part of | ComputerCraft |
| API | Modem |
Examples
| Checks whether the computer is listening on channel 5. | |
| Code |
local modem = peripheral.wrap("top") if modem.isOpen(5) then print("The computer is listening on channel 5.") else print("The computer is not listening on channel 5.") end |
| Output | Whether or not channel 5 is open. |