modem.isOpen

Checks if a channel is open. A channel must be open to receive messages on it. A modem can only have 128 channels open at the same time.

modem.isOpen
Function
Syntax
modem.isOpen(
  • channel : number
)

Returns boolean open
API modem
Source CC:Tweaked (source)

channel must be a Number between 0 and 65535.

ExampleCheck if channel 42 is open
Check if channel 42 is open.
Code
<nowiki>
local modem = peripheral.find("modem")
print(modem.isOpen(42))
    </nowiki>
Output
true
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.