A C D G I M Q U

A

attach(IComputerAccess, String) - Method in interface dan200.computer.api.IPeripheral
Is called when canAttachToSide has returned true, and a computer is attaching to the peripheral.

C

callMethod(IComputerAccess, int, Object[]) - Method in interface dan200.computer.api.IPeripheral
This is called when a lua program on an attached computer calls peripheral.call() with one of the methods exposed by getMethodNames().

Be aware that this will be called from theComputerCraft Lua thread, and must be thread-safe when interacting with minecraft objects.
canAttachToSide(int) - Method in interface dan200.computer.api.IPeripheral
Is called before the computer attempts to attach to the peripheral, and should return whether to allow the attachment.
createNewSaveDir(String) - Method in interface dan200.computer.api.IComputerAccess
Creates a new numbered directory in a subPath of the users game save, and return that number.

D

dan200.computer.api - package dan200.computer.api
 
detach(IComputerAccess) - Method in interface dan200.computer.api.IPeripheral
Is called when a computer is detaching from the peripheral.

G

getID() - Method in interface dan200.computer.api.IComputerAccess
Returns the numerical ID of this computer.
This is the same number obtained by calling os.getComputerID() or running the "id" program from lua, and is guarunteed unique.
getMethodNames() - Method in interface dan200.computer.api.IPeripheral
Should return an array of strings that identify the methods that this peripheral exposes to Lua.
getType() - Method in interface dan200.computer.api.IPeripheral
Should return a string that uniquely identifies this type of peripheral.

I

IComputerAccess - Interface in dan200.computer.api
The interface passed to peripherals by computers or turtles, providing methods that they can call.
IPeripheral - Interface in dan200.computer.api
The interface that defines a peripheral.

M

mountFixedDir(String, String, boolean) - Method in interface dan200.computer.api.IComputerAccess
Mounts a directory into the computers file system, from a real directory in the Minecraft install folder.
For example: mountFixedDir( "stuff", "mods/mymod/lua/stuff", true ), will mount the "lua/stuff" folder from your mod's directory into the computers filesystem at the location "stuff", with readonly permission, giving the computer access to those files.
When a directory is mounted, it will appear in the computers file system, and the user will be able to use file operation to read from and write to the directory (unless readOnly, then only writes will be allowed).
mountFixedDir can also be used to mount files, for example: mountFixedDir( "rom/apis/myapi", "mods/mymod/lua/myapi.lua", true ) can be used to have the peripheral install an API onto the computer it attaches to.
mountSaveDir(String, String, int, boolean) - Method in interface dan200.computer.api.IComputerAccess
Mounts a directory into the computers file system, from a real directory a subPath of the users game save, with a numerical name.

Q

queueEvent(String) - Method in interface dan200.computer.api.IComputerAccess
Equivalent to queueEvent( String event, Object[] arguments ) with an empty arguments array.
queueEvent(String, Object[]) - Method in interface dan200.computer.api.IComputerAccess
Causes an event to be raised on this computer, which the computer can respond to by calling os.pullEvent().

U

unmount(String) - Method in interface dan200.computer.api.IComputerAccess
Unmounts a directory previously mounted onto the computers file system by mountSaveDir or mountFixedDir.
When a directory is unmounted, it will disappear from the computers file system, and the user will no longer be able to access it.

A C D G I M Q U