OpenComputers Interface
The OpenComputers Interface is a peripheral which can be used by OpenComputers computers to interact with screens.
Contents
Recipe
How to use
First, place the block next to an OpenComputers computer and link it to a screen using the Linking Tool. Then, you'll need its OpenComputers address, which can be obtained this way:
component = component or require("component")
wdScreenAddress = nil
for addr, name in component.list() do
if name == "webdisplays" then
wdScreenAddress = addr
break
end
end
if not wdScreenAddress then
print("Couldn't find WebDisplays screen")
return
endThen, you'll need a proxy to execute WebDisplays functions:
wdScreen = component.proxy(wdScreenAddress)This process is detailed on the OpenComputers wiki.
Permissions
This interface will have the same restrictions and permissions as the player who placed the block.
Functions
| Query name | Arguments | Return value | Comment |
|---|---|---|---|
| isLinked | None | bool | |
| isScreenChunkLoaded | None | bool | |
| getScreenPos | None | number, number, number | |
| getScreenSide | None | string | |
| getOwner | None | string, string | Returns name & UUID |
| can | string | bool | Check for permission |
| hasUpgrade | string | bool | Upgrade name is case insensitive |
| getSize | None | number, number | |
| getResolution | None | number, number | |
| getRotation | None | number | In degrees |
| getURL | None | string | |
| click | number, number, string | bool | Arguments are x, y, action. Action can by click, up, or down. Rotation is handled internally. |
| type | string | bool | |
| typeAdvanced | string | bool | Manually control key up/down events. |
| setURL | string | bool | |
| setResolution | number, number | bool | |
| setRotation | number | bool | In degrees |
| runJS | string | bool | |
| unlink | None | None | Why would anyone do that? |
