Getting Started

From ComputerCraft Wiki
Revision as of 01:27, 19 July 2012 by 202.60.66.36 (Talk) (Prerequisite: Installing the mods)

Jump to: navigation, search

Darv59125 dit :Je viens de m'inscrire sur YouTube juste pour toi (enfin pour le moment).Tes vide9os sont s'tordinaire comme diirat l'autre, elle mon appris plein de truc, fin bref Cette saison nous promet de beaux e9pisodes ^^ Pour ton pin peut eatre que avec de l'eau il pousserais plus vite, meame si la premie8re nuit c'est pas vraiment l'objectif et que c'est presque hors de porte9.Bonne continuation

Step 1: Crafting the console

The recipe is simple:

stone

stone

stone

stone

glass pane

stone

stone

stone




Right click on the console to use it.
These are important to remember:

Shortcut Usage
CTRL + T Closes the current program.
CTRL + R Reboots the console.
CTRL + S Forcefully shuts down the computer.

NOTE: You have to hold the keyboard shortcuts down for at least 1 second!
These are forced and will close the current program, even if it is still running.

Step 2: Wiring it all up

The console accepts many forms of redstone. For simple structures, such as a password protected door, only a single line of redstone is needed. However, this mod can do much more. If you need to connect multiple wires to one side, you can just use RedPower's cables. Easy peasy. Or, you don't do anything in this part. The computer has some great games shipped with and it is even capable of loading web pages.

Step 3: Programming your system

If you've programmed before this shouldn't be hard. It'll feel very comfortable.

Type

edit <filename>

in the terminal to open the included feature-rich text editor. To get the hang of Lua if you're new, use

edit /rom/programs/hello

to view the code of a simple program 'hello'.

Navigating is easy.

> ls
rom
> cd rom
rom> ls
apis   help   programs
startup
rom> cd programs
rom/programs> cd /
>

To say it in English: ls lists the files and folders in a directory, while cd changes the current directory. / is the root of the computer. Again, you don't have to program, but it's a big part of the mod. But you can still play those games.

Step 4: Test it

Make sure that your program is bug-proof before using it as something important. A system controlling the state of an IndustrialCraft² Mark-III Nuclear Reactor to prevent it from overheating shouldn't crash every now and then with "Too long without yielding".

Step 5: Extend it

Give back your part to the community. Help others on the forums or improve the wiki. Or, make your own OS or shell to run on the computers and share it with everybody. You can even create your own peripheral blocks using the API to create even a bigger system. A mainframe, for example.