Skip to content
Gilberto Romero edited this page Sep 5, 2016 · 9 revisions

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.

Table of Contents

Programs

  • Adv
  • Cdisp
  • Cmd
  • Edit
  • Lua
  • Paint

Libraries

  • Event
  • Font
  • Filesystem
  • Term
  • Colors
  • Json
  • Keys
  • Shell
  • Soundsystem

Programs

Libraries

Event

Font

Filesystem

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.

fs.open( string file, string mode )

Returns: file File

Works just like io.open, except it prevents writing to files that are protected.

fs.preparePath( string path )

Automatically creates folders to the given path if there aren't any already.

fs.makeDir( string dir )

Works just like io.makeDir, except it prevents writing to files that are protected.

fs.copy( string path1, string path2 )

Copies the entire folder or file from path1 to path2, given path2 is non-existant and is not protected.

fs.move( string path1, string path2 )

Moves the entire folder or file from path1 to path2, given path2 is non-existant and is not protected.

fs.delete( string path1, string path2 )

Works just like os.remove, except it prevents the deletion of protected files and folders.

fs.listFiles( string path )

Returns: table fileList

Uses io.list to return a table indexed numerically with file names.

fs.listFolders( string path )

Returns: table fileList

Uses io.list to return a table indexed numerically with folder names.

fs.protect( string path )

Protects the file or entire folder given from modification.

fs.isProtecting( string path )

Returns: boolean hasProtection

Returns whether or not the file or folder given is being protected by fs.

Term

Colors

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

Json

The Json API allows for the encoding of tables into JSON formatted strings, and the conversion of said strings back into table format.

json.encode( table Json )

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".

json.decode( string Json )

Returns: table Json

Turns a formatted JSON string into it's table equivalent. All values set to null will be ignored.

Keys

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].

Shell

Soundsystem

Clone this wiki locally