peripheral.wrap

Allows you to use a peripheral’s functions at the specified side or network name.

ExampleOpen the modem right of the computer/turtle.
Open the modem right of the computer/turtle.
Code
<nowiki>
local modem = peripheral.wrap("modem_1234")
rednet.open(modem)
</nowiki>
Output true

peripheral.wrap
Function
Syntax
peripheral.wrap(
  • 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.