Difference between revisions of "Getting Started"

From ComputerCraft Wiki
Jump to: navigation, search
(Undo revision 2981 by 95.155.212.152 (talk))
m (Crafting)
 
(42 intermediate revisions by 25 users not shown)
Line 1: Line 1:
 
== Prerequisite: Installing the mods ==
 
== Prerequisite: Installing the mods ==
 
'''It is very important to read everything carefully before asking questions.'''
 
'''It is very important to read everything carefully before asking questions.'''
'''Also, the latest version this mod may not be compatible with the current Minecraft release.'''
+
'''Also, the latest version of this mod may not be compatible with the current Minecraft release.'''
  
# Install [http://jenkins.minecraftforge.net:7070/job/forge/171/ Minecraft Forge Recommended Build]
+
# Install the appropriate [http://files.minecraftforge.net/ Minecraft Forge Recommended Build] for your Minecraft version
# Download the latest version of [http://www.minecraftforum.net/topic/892282- ComputerCraft]
+
# Download the latest version of [http://www.computercraft.info/download/ ComputerCraft] for your Minecraft version
# Copy OR extract the .zip file into *minecraft folder*\mods\. (Tip: If on Windows, on the main screen of Minecraft, go to 'Texture Packs' and click on 'Open texture pack folder'. Go up one folder, there's your Minecraft folder. If on Mac, open Finder, hit Command+Shift+G and type ~/Library/ then hit enter, open 'Application Support' then open 'minecraft')
+
# Copy the .jar file into *minecraft folder*\mods\ or into your specified profile. (Tip: If on Windows, on the main screen of Minecraft, go to 'Texture Packs' and click on 'Open texture pack folder'. Go up one folder, there's your Minecraft folder. If on Mac, open Finder, hit Command+Shift+G and type ~/Library/ then hit enter, open 'Application Support' then open 'minecraft')
<!-- [11:36.53] <+Cruor|zZz> it can be in a zip in 1.41 :p -->
+
<!-- Both the zip or folder work. Please do not edit this without proof.
<!-- [11:36.57] <Mandrake> yes -->
+
Aha, but the folder doesn't work anymore since 1.6 -->
<!-- [11:37.03] <@FuzzyPurp> it is a zip in 1.41 -->
+
  
== Step 1: Crafting your first console ==
+
== Crafting ==
The recipe is simple:<br />
+
{{Crafting
{{Crafting grid
+
 
|A1=stone |B1=stone      |C1=stone
 
|A1=stone |B1=stone      |C1=stone
|A2=stone |B2=redstone   |C2=stone
+
|A2=stone |B2=Redstone   |C2=stone
 
|A3=stone |B3=glass pane |C3=stone
 
|A3=stone |B3=glass pane |C3=stone
|Output=console
+
|Output=Computer
 
}}
 
}}
<br />
 
  
Right click on the console to use it.<br />
+
Right click on the computer to use it.<br />
Some important keys to remember:
+
Some important key combinations to remember:
 
{| border="1" cellpadding="2" cellspacing="0"
 
{| border="1" cellpadding="2" cellspacing="0"
!style="background:#EEE" width="200px"|Shortcut
+
!style="background:#EEE" width="200px"|Key Combination
 
!style="background:#EEE" width="*"|Usage
 
!style="background:#EEE" width="*"|Usage
 
|-
 
|-
|CTRL + T
+
|{{Keypress|key=CTRL}} + {{Keypress|key=T}}
 
|Closes the current program.
 
|Closes the current program.
 
|-
 
|-
|CTRL + R
+
|{{Keypress|key=CTRL}} + {{Keypress|key=R}}
|Reboots the console.
+
|Reboots the computer.
 
|-
 
|-
|CTRL + S
+
|{{Keypress|key=CTRL}} + {{Keypress|key=S}}
 
|Forcefully shuts down the computer.
 
|Forcefully shuts down the computer.
 
|}
 
|}
NOTE: You have to hold the keyboard shortcuts down for at least 1 second!<br />
+
You usually will have to hold down the key combinations for at least 1 second<br />
These are forced (CRTL+T can be disabled by a program).
+
  
== Step 2: Wiring it all up ==
+
== Attaching hardware ==
The console accepts many forms of redstone. For simple structures, such as a password protected door, only a single line of redstone is needed.
+
You can a bunch of stuff to your computer. There are 6 sides to the sides of your computer, and the computer can interact with almost anything there that it can interact with. This includes [[Modem|modems]] [[Modem_(API)|(API)]], [[Disk_Drive|disk drives]] [[Fs_(API)|(API)]], [[Printer|Printers]] [[Printer_(API)|(API)]], [[Monitor|monitors]] [[Term_(API)|(API)]], and even redstone [[Rs_(API)|(API)]]! Connect these to the sides of your computer and use the appropriate API to control your hardware.
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 ==
+
== Using the computer 's shell ==
If you've programmed anything before this shouldn't be hard. It'll feel very comfortable.
+
Your computer should come with CraftOS as long as you didn't mod the mod.
 +
If you have ever used the Linux terminal or Command Prompt or DOS or something similar, shell usage should be pretty simple.  
  
NOTE:You may also want to make some floppy disks to use along with your machine
+
However the CraftOS Shell is even simpler and it only has one thing you can do: Type the name of a program (along with arguments) and it will run.
  
Type
+
A few useful programs that will help you magically appear on every computer you use, because they are in the universal ''rom'' folder that every computer can access.
edit <filename>
+
{| border="2" cellpadding="2" cellspacing="0"
in the terminal to open the included feature-rich <!-- Save and exit!!! --> text editor. To get the hang of Lua if you're new, use
+
|cd
edit /rom/programs/hello
+
|'''C'''hanges the current working '''d'''irectory of the shell, so you can do something else.
to view the code of a simple program 'hello'.
+
|-
 +
|ls
 +
|'''L'''i'''s'''ts the contents of the working directory, with directories in green and files in white.
 +
|-
 +
|rm
 +
|'''R'''e'''m'''oves (deletes) a file or folder
 +
|-
 +
|mkdir
 +
|'''M'''a'''k'''es an empty '''dir'''ectory
 +
|-
 +
|mv
 +
|'''M'''o'''v'''es a file to another path
 +
|-
 +
|cp
 +
|'''C'''o'''p'''ies a file under another name
 +
|}
 +
 
 +
== Programming your computer ==
 +
    For programming tutorials, ''go to'': [[Tutorials]]
 +
 
 +
Programming ComputerCraft computers is done with a programming language called Lua. Lua is intended to be pretty simple to use, but if you don't know how, you can check out the programming tutorials on this wiki.
 +
 
 +
 
 +
----
 +
Do you recall that one time ages ago when you looked up "how to play Minecraft", and you got a basic guide: punch trees, make bench, make tools, build house, make torches. But do you remember the end?
  
Navigating is easy.
+
''The rest is up to you...''
> ls
+
rom
+
> cd rom
+
rom> ls
+
apis  help  programs
+
startup
+
rom> cd programs
+
rom/programs> cd /
+
>
+
To say it in English: ls '''l'''i'''s'''ts the files and folders in a directory, while cd changes the '''c'''urrent '''d'''irectory. '''/''' 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 ==
+
ComputerCraft works the same way. The goals and uses for ComputerCraft are limitless, and now you've gotten started. There is no definite thing to do next, the rest is up to you.
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 ==
+
[[Category:Tutorials]]
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.
+

Latest revision as of 06:19, 4 August 2020

Prerequisite: Installing the mods

It is very important to read everything carefully before asking questions. Also, the latest version of this mod may not be compatible with the current Minecraft release.

  1. Install the appropriate Minecraft Forge Recommended Build for your Minecraft version
  2. Download the latest version of ComputerCraft for your Minecraft version
  3. Copy the .jar file into *minecraft folder*\mods\ or into your specified profile. (Tip: If on Windows, on the main screen of Minecraft, go to 'Texture Packs' and click on 'Open texture pack folder'. Go up one folder, there's your Minecraft folder. If on Mac, open Finder, hit Command+Shift+G and type ~/Library/ then hit enter, open 'Application Support' then open 'minecraft')

Crafting

Empty-crafting-table.png
Grid stone.png
Grid stone.png
Grid stone.png
Grid stone.png
Grid Redstone.png
Grid stone.png
Grid Computer.png
Grid stone.png
Grid glass pane.png
Grid stone.png

Right click on the computer to use it.
Some important key combinations to remember:

Key Combination Usage

CTRL + T

Closes the current program.

CTRL + R

Reboots the computer.

CTRL + S

Forcefully shuts down the computer.

You usually will have to hold down the key combinations for at least 1 second

Attaching hardware

You can a bunch of stuff to your computer. There are 6 sides to the sides of your computer, and the computer can interact with almost anything there that it can interact with. This includes modems (API), disk drives (API), Printers (API), monitors (API), and even redstone (API)! Connect these to the sides of your computer and use the appropriate API to control your hardware.

Using the computer 's shell

Your computer should come with CraftOS as long as you didn't mod the mod. If you have ever used the Linux terminal or Command Prompt or DOS or something similar, shell usage should be pretty simple.

However the CraftOS Shell is even simpler and it only has one thing you can do: Type the name of a program (along with arguments) and it will run.

A few useful programs that will help you magically appear on every computer you use, because they are in the universal rom folder that every computer can access.

cd Changes the current working directory of the shell, so you can do something else.
ls Lists the contents of the working directory, with directories in green and files in white.
rm Removes (deletes) a file or folder
mkdir Makes an empty directory
mv Moves a file to another path
cp Copies a file under another name

Programming your computer

   For programming tutorials, go to: Tutorials

Programming ComputerCraft computers is done with a programming language called Lua. Lua is intended to be pretty simple to use, but if you don't know how, you can check out the programming tutorials on this wiki.



Do you recall that one time ages ago when you looked up "how to play Minecraft", and you got a basic guide: punch trees, make bench, make tools, build house, make torches. But do you remember the end?

The rest is up to you...

ComputerCraft works the same way. The goals and uses for ComputerCraft are limitless, and now you've gotten started. There is no definite thing to do next, the rest is up to you.