-
Notifications
You must be signed in to change notification settings - Fork 192
Component API
This library allows to interact with external components. By default, OpenComputers already has a global component library. In addition to it, MineOS adds some useful methods.
| Contents |
|---|
| OpenComputers methods |
| component.proxy |
| component.list |
| component.doc |
| component.invoke |
| MineOS methods |
| component.isAvailable |
| component.get |
Returns proxy of component with given address is this component is available or nil otherwise.
component.proxy("3da4522c-ddf0-42ee-8a3d-2ec3a80b0769")> tableReturns an iterator function over available components matching given name or just all components:
for address, name in component.list("gpu") do
-- Do something
endReturns the documentation string for the method with given name of the component with given address if any, or nil otherwise.
Calls the method with given name on the component with given address, passing the remaining arguments as arguments to that method. Returns the result of the method call.
Checks if any component with given name is available in computer environment:
component.isAvailable("gpu")> trueReturns proxy of first available component with given name on success, nil otherwise.
component.get("gpu")> table