From ComputerCraft
Jump to navigation Jump to search

Returns table
API peripheral
Source CC:Tweaked (source)

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, for the given peripheral.

Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden
ExampleList methods of the peripheral on the left
This prints all the methods of whatever peripheral is on the left of the computer this is run on. You can replace "left" with another side or a peripheral's network name to list its methods instead
for _, method in pairs(peripheral.getMethods "left") do
Output Depends on the peripheral on the left. If there is none it will error. As an example, for a modem, the methods it lists will include transmit, isOpen, isWireless, open, close, and closeAll.