-
Notifications
You must be signed in to change notification settings - Fork 0
StarOS
StarOS is a terminal-based OS which provides basic APIs, programs, and utilities for users who are looking for rapid programming. The OS itself can be bought from the Output (Not yet implemented) or crafted for quick availability. Here you'll find information about how to use the various APIs provided to users and the programs that come built-in.
- Adv
- Cdisp
- Cmd
- Edit
- Lua
- Paint
- Event
- Font
- Filesystem
- Term
- Colors
- Json
- Keys
- Shell
- Soundsystem
The filesystem API, shortened to just "fs", is built ontop of the IO API, providing for protection and automatic folder generation when referring to paths that don't exist. The protection offered by the fs API can easily be bypassed by the IO API, if one ever needs to do so.
Returns: file File
Works just like io.open, except it prevents writing to files that are protected.
Automatically creates folders to the given path if there aren't any already.
Works just like io.makeDir, except it prevents writing to files that are protected.
Copies the entire folder or file from path1 to path2, given path2 is non-existant and is not protected.
Moves the entire folder or file from path1 to path2, given path2 is non-existant and is not protected.
Works just like os.remove, except it prevents the deletion of protected files and folders.
Returns: table fileList
Uses io.list to return a table indexed numerically with file names.
Returns: table fileList
Uses io.list to return a table indexed numerically with folder names.
Protects the file or entire folder given from modification.
Returns: boolean hasProtection
Returns whether or not the file or folder given is being protected by fs.
The Colors API is a table full of color names for more convienient and readable color switching. It has 16 names, the names being that of the colors available to the first tier GPU. They are as follows:
colors.black
colors.camarone
colors.jlaurel
colors.green
colors.blue
colors.bribbon
colors.azurer
colors.cyan
colors.red
colors.iorange
colors.worange
colors.yellow
colors.magenta
colors.pinkf
colors.lrose
colors.white
The Json API allows for the encoding of tables into JSON formatted strings, and the conversion of said strings back into table format.
Returns: string Json
Turns a table into a JSON formatted string, useful for saving to file to allow for easily editable user configs. It should be noted that it cannot encode functions, userdata, nor threads. It should also be noted that it doesn't do very well with mixed tables; If the table has any non-nil value at it's first index, then it will treat the table as an array. If not, it will treat the table as an object, so be sure to keep your tables non-mixed. Lastly, the only way to have any particular value be saved as a null is to set said value to the string "null".
Returns: table Json
Turns a formatted JSON string into it's table equivalent. All values set to null will be ignored.
The Keys API is simply a table to allow for number to key conversion and back. For example, if you wanted to know what the letter "a" was in number format when checking keyboard input, you'd lookup keys.a. However, if you wanted to know what letter the number 43 represents, you'd lookup keys[43].















