-
Notifications
You must be signed in to change notification settings - Fork 443
APIs
First and foremost you should get familiar with the Lua reference manual, if you are new to Lua. You will find most basic Lua functionality explained there, as well as a bunch of standard library functions.
OpenComputers makes an effort to largely emulate the standard library in areas that would usually interact with the host system - that being the I/O library. There are a few differences, which you can look up here: differences in the standard libraries. Most notably, the debug and package libraries are not available, and load
only accepts text source files, no binary / pre-compiled Lua programs (for security reasons).
The standard libraries aside, OpenComputers comes with a couple of additional, built-in libraries. Here is a list of all these libraries. Note that some of these may not be usable depending on your configuration (HTTP) and context (Robot library on computers), but they'll still be there.
-
Buffer: a Lua
FILE*
API buffer implementation for wrapping streams. - Colors: a global table that allows referencing standard Minecraft colors by name.
- Component: look-up and management of components attached to the computer.
- Computer: information on and interactions with the computer the Lua state is running on.
- Event: a very rudimentary event system (intended for libraries) and filtered signal pulling.
- FileSystem: abstracted interaction with file system components.
- Internet: a wrapper for Internet Card functionality.
- Keyboard: a table of key codes by name and pressed key tracking.
- Process: keeps track of running programs and their environments
- Robot: abstracted access to robot actions.
- Serialization: allows serialization of values, e.g. for sending them via the network.
- Shell: working path tracking and program execution.
- Sides: a global table that allows referencing sides by name.
- Term: provides a simple readline implementation and text output.
- Text: provides text utilities such as serialization and tab to space conversion.
- Unicode: provides Unicode aware implementations of some functions in the string library.