Difference between revisions of "Peripheral (API)"
m (Fix all teh typos!) |
(Completed merge of peripheral maps to their actual item/block pages. (+1 usability)) |
||
Line 43: | Line 43: | ||
|} | |} | ||
==Monitor== | ==Monitor== | ||
− | + | [[Monitor#Peripheral_Functions|Monitor Peripheral functions]] have been moved to the [[Monitor]] page. | |
− | + | In addition, the [[Advanced_Monitor#Peripheral_Functions|Advanced Monitor Peripheral functions]] have been moved to the [[Advanced Monitor]] page. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
==Printer== | ==Printer== | ||
− | + | [[Printer#Peripheral_Functions|Printer Peripheral functions]] have been moved to the [[Printer]]page. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
==Computers== | ==Computers== | ||
− | + | [[Console#Peripheral_Functions|Computer Peripheral functions]] have been moved to the [[Computer]] page. | |
− | + | In addition, the [[Advanced_Computer#Peripheral_Functions|Advanced Computer Peripheral functions]] have been moved to the [[Advanced Computer]] page. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 00:00, 29 November 2012
The Peripheral API is for interacting with external peripherals, such as the Disk Drive, the Advanced Monitor and Monitor.
Consoles and Turtles are also considered peripherals and you can interface two adjacent computers, although in a more limited fashion compared to rednet. Both Computers and Turtles provide the same methods: turnOn, shutdown, reboot, getID.
Contents
Methods
Method name | Description |
---|---|
peripheral.isPresent(side) | Returns true if a peripheral is present on side. |
peripheral.getType(side) | Returns the type or peripheral present on side, nothing returned if side is empty. |
peripheral.getMethods(side) | Returns a table containing all methods for peripheral on side. |
peripheral.call(side, methodName, param1, param2, ...) | Sends a function call to peripheral located on side. Return values match those of called method. Note: methodName is a string. |
peripheral.wrap(side) | Returns a handle to the peripheral located on side. If assigned to a variable, it can be used to call all methods available from that peripheral, as if calling peripheral.call(), e.g.: m = peripheral.wrap("left") |
Events
Event name | Description | Parameters |
---|---|---|
peripheral | Fired when peripheral is attached | side |
peripheral_detach | Fired when peripheral is removed | side |
Monitor
Monitor Peripheral functions have been moved to the Monitor page. In addition, the Advanced Monitor Peripheral functions have been moved to the Advanced Monitor page.
Printer
Printer Peripheral functions have been moved to the Printerpage.
Computers
Computer Peripheral functions have been moved to the Computer page. In addition, the Advanced Computer Peripheral functions have been moved to the Advanced Computer page.