-
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 Outpost (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
The Font API is a table index by characters usable by keyboards. It contains said data in texture format as to be drawn to the GPU quickly, as well as extra information such as character offset to be used by the Term API. Be aware that it's not like the Keys API, and that while you would do keys.one for the Keys API, you would do font["1"] for the Font API.
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 Term API is used to display text, be it colored or not, on the screen, making it very useful for outputting text that needs to be easily seen.
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].
The following don't really belong anywhere else but here.
Writes the values given to it on screen with a new line for every value given.
Writes the given error string on screen in the color red. Be aware that this does not actually exit from your program.
The following functions have been re-implemented in the OS:
**Returns: ** string fileName
Returns a temporary file name that can be written to.
Returns: var
Can be used to get OS environment variables, where var is usually a string or number. The following variables are currently gettable/settable:
-
OS(Defaults to"StarOS") -
Version(Defaults to1.0) -
ComputerName(Defaults to"Computer") -
%TMP%(Defaults to"C:/tmp") -
%DATA%(Defaults to"C:/data") -
%STARTUP%(Defaults to"C:/startup.lua")
Can be used to set OS environment variables, where data is recommended to be a string or number.
Uses a separate shell, works as an alias for shell.execute() for said separate shell.
Returns: file temporaryFile
Returns a file that can be written to.
Currently an alias for term.read()
Currently an alias for term.write()
Currently an alias for printError()















