CraftOS

From ComputerCraft Wiki
(Redirected from TurtleOS)
Jump to: navigation, search
Is this the page you were looking for?
This is the article for ComputerCraft's primary shell, CraftOS. If you are looking for the API, see shell (API).
The CraftOS interface.
CraftOS is the default shell used by ComputerCraft's systems. It offers a command line interface, making use of a selection of Unix-style commands for navigation.

It is launched automatically when a given Computer, Turtle or Pocket Computer starts up, from the file /rom/programs/shell (for a time, it labelled itself as "TurtleOS" when executed on turtles - currently it calls itself "CraftOS" on all systems). It then initialises the shell API which other scripts can use to interface with it. If the first instance of CraftOS running on a system is exited, the system will shut down.

As of ComputerCraft 1.6, advanced systems launch CraftOS via the Multishell script, which enables easy multitasking (allowing the one device to run multiple programs at the same time, in different tabs). ComputerCraft 1.74 furthermore added tab-completion to the interface.

Alternate "operating systems" can either run "on top of" CraftOS, or, using a resource pack, they can replace it altogether. Many user-defined OSes can be found in the ComputerCraft forums, but note that not all are fully-functional and/or compatible with all versions of ComputerCraft.

Quick Guide

When first starting a system, it is recommended to label it - an unlabelled computer's file system will be discarded if it is pickaxe'd and re-placed (in the case of turtles, their fuel reserves will also be lost). To check the current label of a system, enter:

label get

To set a new label, enter:

label set <newLabel>

From there, use is similar to a standard Unix-style prompt - see here for the command list, and try the help script to get details on commands you're unclear about.

For example, to view a list of files on the system, enter:

ls

You can change to a different folder by entering:

cd <folderName>

To go back a directory, enter:

cd ..

To run a script file, simply enter its name. If you wish to edit a script file, use the edit command:

edit <scriptName>

Note that you cannot edit the contents of the rom (Read-Only Memory) directory, nor that of Treasure Disks.

Also try the included lua script, which gives you immediate access to a Lua interpreter.

See Also