Along with the
emu command, CCEmuX provides an API which allows you to interact with the emulator,
providing functionality you wouldn't have under normal ComputerCraft.
If you do not want access to the
emu program or
ccemux API, one
can disable the "CCEmuX API" plugin.
Returns the current emulator version.
Open a new emulator window. If the ID is given, a computer with the specific ID will be created, otherwise the next available ID will be used.
This function returns the ID of the new computer.
Shutdown the computer and close the current emulator window.
Attempt to open CCEmuX's data directory in your file browser. This returns whether it could successfully be opened or not.
Attempt to open CCEmuX's config editor. This returns whether it could successfully be opened or not. In the event of a failure, an error message should also be returned.
Get the current time in milliseconds. This is equivalent to
Get the current time in nanoseconds. Unlike
ccemux.milliTime, this is not related to any "real
world" time. It should only be compared with other values returned by
ccemux.nanoTime, generally to
measure how long something takes.
Log a message to CCEmuX's console. This may be useful when running CCEmuX on a headless server, where you still need to monitor the output of a program.
Set the current system clipboard, allowing a string to be pasted into other applications more easily.
ccemux.attach(side:string, peripheral:string[, options:table])
Attach a new peripheral on the given side, replacing whichever peripheral was there already. For more information about the various peripherals available, and how to interact with them see the peripheral documentation.
Detach whichever peripheral is on the given side.