Peripheral API
|
|||||||||||
Calls a peripheral's function directly, at the specified side or network name. | |||||||||||
Syntax | peripheral.call(
|
||||||||||
Returns | anything | ||||||||||
Part of | CC:Tweaked | ||||||||||
API | peripheral | ||||||||||
See also | peripheral.wrap | ||||||||||
|
|
|||||||||||
Find a peripheral on the network. | |||||||||||
Syntax | peripheral.find(
|
||||||||||
Returns | table | ||||||||||
API | peripheral | ||||||||||
|
|
|||||||||||
Returns a table listing the names of all the methods (roughly, operations it is capable of doing) supported by a given peripheral. Any of the methods it lists can be called using the peripheral object returned by peripheral.wrap and peripheral.find, or using peripheral.call, for the given peripheral. | |||||||||||
Syntax | peripheral.getMethods(
|
||||||||||
Returns | table | ||||||||||
Part of | CC:Tweaked (source) | ||||||||||
API | peripheral | ||||||||||
|
|
|||||||||
Returns the network names of all peripherals connected to the computer. You can pass these to peripheral.getType, peripheral.getMethods, peripheral.isPresent, and peripheral.wrap. | |||||||||
Syntax | peripheral.getNames() | ||||||||
Returns | table | ||||||||
Part of | CC:Tweaked (source) | ||||||||
API | peripheral | ||||||||
|
|
|||||||||||
Returns the type of peripheral attached at the specified side or network name. Returns nil when no peripheral is attached at the specified side or network name. | |||||||||||
Syntax | peripheral.getType(
|
||||||||||
Returns | boolean result | ||||||||||
Part of | Lua (source) | ||||||||||
API | peripheral | ||||||||||
|
|
|||||||||||
Returns if there's a peripheral attached at the specified side or network name. | |||||||||||
Syntax | peripheral.isPresent(
|
||||||||||
Returns | boolean result | ||||||||||
Part of | Lua (source) | ||||||||||
API | peripheral | ||||||||||
|
|
|||||||||||
Allows you to use a peripheral’s functions at the specified side or network name. | |||||||||||
Syntax | peripheral.wrap(
|
||||||||||
Returns | boolean result | ||||||||||
Part of | Lua (source) | ||||||||||
API | peripheral | ||||||||||
|
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.