public interface IComputerAccess
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttachmentName()
Get a string, unique to the computercraft, by which the computercraft refers to this peripheral.
|
int |
getID()
Returns the numerical ID of this computercraft.
This is the same number obtained by calling os.getComputerID() or running the "id" program from lua, and is guarunteed unique. |
java.lang.String |
mount(java.lang.String desiredLocation,
IMount mount)
Mount a mount onto the computers' file system in a read only mode.
|
java.lang.String |
mount(java.lang.String desiredLocation,
IMount mount,
java.lang.String driveName)
TODO: Document me
|
java.lang.String |
mountWritable(java.lang.String desiredLocation,
IWritableMount mount)
Mount a mount onto the computers' file system in a writable mode.
|
java.lang.String |
mountWritable(java.lang.String desiredLocation,
IWritableMount mount,
java.lang.String driveName)
TODO: Document me
|
void |
queueEvent(java.lang.String event,
java.lang.Object[] arguments)
Causes an event to be raised on this computercraft, which the computercraft can respond to by calling
os.pullEvent().
|
void |
unmount(java.lang.String location)
Unmounts a directory previously mounted onto the computers file system by mount() or mountWritable().
When a directory is unmounted, it will disappear from the computers file system, and the user will no longer be able to access it. |
java.lang.String mount(java.lang.String desiredLocation, IMount mount)
desiredLocation
- The location on the computercraft's file system where you would like the mount to be mounted.mount
- The mount object to mount on the computercraft. These can be obtained by calling ComputerCraftAPI.createSaveDirMount(), ComputerCraftAPI.createResourceMount() or by creating your own objects that implement the IMount interface.dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String)
,
ComputerCraftAPI.createResourceMount(Class, String, String)
,
mountWritable(String, dan200.computercraft.api.filesystem.IWritableMount)
,
unmount(String)
,
IMount
java.lang.String mount(java.lang.String desiredLocation, IMount mount, java.lang.String driveName)
java.lang.String mountWritable(java.lang.String desiredLocation, IWritableMount mount)
desiredLocation
- The location on the computercraft's file system where you would like the mount to be mounted.mount
- The mount object to mount on the computercraft. These can be obtained by calling ComputerCraftAPI.createSaveDirMount() or by creating your own objects that implement the IWritableMount interface.dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String)
,
ComputerCraftAPI.createResourceMount(Class, String, String)
,
mount(String, IMount)
,
unmount(String)
,
IMount
java.lang.String mountWritable(java.lang.String desiredLocation, IWritableMount mount, java.lang.String driveName)
void unmount(java.lang.String location)
location
- The desired location in the computers file system of the directory to unmount.
This must be the location of a directory previously mounted by mount() or mountWritable(), as
indicated by their return value.mount(String, IMount)
,
mountWritable(String, IWritableMount)
int getID()
void queueEvent(java.lang.String event, java.lang.Object[] arguments)
event
- A string identifying the type of event that has occurred, this will be
returned as the first value from os.pullEvent(). It is recommended that you
you choose a name that is unique, and recognisable as originating from your
peripheral. eg: If your peripheral type is "button", a suitable event would be
"button_pressed".arguments
- In addition to a name, you may pass an array of extra arguments to the event, that will
be supplied as extra return values to os.pullEvent(). Objects in the array will be converted
to lua data types in the same fashion as the return values of IPeripheral.callMethod().IPeripheral.callMethod(dan200.computercraft.api.peripheral.IComputerAccess, dan200.computercraft.api.lua.ILuaContext, int, java.lang.Object[])
java.lang.String getAttachmentName()