peripheral.isPresent

Returns if there's a peripheral attached at the specified side or network name.

ExampleCheck if there is a peripheral attached on top.
Checks and prints if there is a peripheral attached to the top side.
Code
print(peripheral.isPresent("top"))
Output true

peripheral.isPresent
Function
Syntax
peripheral.isPresent(
  • side or network name : string
)

Returns boolean result
API peripheral
Source Lua (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.