This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lettuce's profile picture

How to Add/Remove Programs in CC

Started by Lettuce, 08 September 2012 - 02:36 PM
Lettuce #1
Posted 08 September 2012 - 04:36 PM
This is a tutorial for a handful of useful features for ComputerCraft. It will go through adding/removing programs from your computer, using an out-of-game text editor for your programming, along with my personal recommendation for all your Lua (Loo-uh) programming needs. I listen to all requests, and if you request something that I know how to do, I will post another tutorial. This tutorial was made using "Windows Vista" so SOME sections may not work, like un-hiding file extensions.

Let's get started.

SpoilerChapter One — My personal program editor.
SpoilerI use Notepad++, a very versatile editor with a series of programming langauges built in, including Lua, which is what ComputerCraft uses. It is free, and simple to use, even letting you see where your functions end, or if they end, making it much, much, easier to fix them. Find it at notepad-plus-plus.org (Copy and paste into your address bar)
Chapter Two — How to save files properly for out-of-game editors.
SpoilerWhen you save your file, you must edit its name afterwards, to remove the extension. Like so:
To see your extensions:
Spoiler1. Go to a folder, like "My Documents" and click "Tools" at the top.
2. At the bottom of the pop-out menu, you should see "Folder Options." Click it.
3. Click the "View" tab at the top.
4. Now look at the menu. You should see "Hide extensions for known file types" is checked.
5. Uncheck it, and you will see your file extensions, like.txt, .rtf, .lua, etc.

Right click and select "Rename" Then delete the extension, and ignore Windows' warning. Don't worry, you won't break the file. Now insead of reading
"test.txt" it should only read "test", and now ComputerCraft can read it.

Chapter 3 — Adding/Removing Programs
Spoiler


Pick subsection:

Adding Programs
Spoiler


Pick subsection #2:

Adding from an external editor (like Notepad++)
Spoiler1. Find your file, wherever you saved it. Make sure there is no extension.
2. Open up .minecraft, and open up the "mods" folder.
3. Go to the ComputerCraft folder, whatever you named it.
4. Get in the "lua" folder.
5. Get in the "rom" folder.
6. Get in the "programs" folder.
7. Depending on what your program is for, put it in "computer" or "turtle".

Adding from the in-game editor
Spoiler1. Go to .minecraft, and enter the "saves" folder.
2. Go to the name of your world, and get in that folder.
3. Go to the "computer" folder.
4. Listed is every computer that has ever been made in your world, the majority of folders probably empty.
5. Find the file, through trial and error.
6. Now go back to .minecraft, with the computer's folder open.
7. Open up the "mods" folder.
3. Go to the ComputerCraft folder, whatever you named it.
4. Get in the "lua" folder.
5. Get in the "rom" folder.
6. Get in the "programs" folder.
7. Depending on what your program is for, put it in "computer" or "turtle".

Removing Programs
SpoilerPick subsection #2:

From the world:
Spoiler1. Go to .minecraft
2. Go to "saves"
3. Find the world you stored the file in.
4. Go to "computer"
5. Listed is all your computers that have ever been made in that world.
6. Find the file, through trial and error.
7. Right-Click, and press "Delete."



From all computers:
Spoiler1. Go to .minecraft
2. Go to "mods"
3. Get in your ComputerCraft folder, whatever you named it.
4. Get in the "lua" folder.
5. Go to "rom"
6. Go to the "programs" folder.
7. Click on whatever you saved it in, "computer" or "turtle".
8. Delete the file, removing it from all computers/turtles globally.






I hope this helped you.
–Lettuce
Mtdj2 #2
Posted 08 September 2012 - 06:19 PM
Uhm, first, removing from computers is much more simple than that. Boot computer and type: "rm <filename>", and second, test.txt CAN be read by computercraft, renaming from computers is only "rename <filename> <desired filename>".

Hope I helped the people.
Lettuce #3
Posted 08 September 2012 - 06:58 PM
Uhm, first, removing from computers is much more simple than that. Boot computer and type: "rm <filename>", and second, test.txt CAN be read by computercraft, renaming from computers is only "rename <filename> <desired filename>".

Hope I helped the people.

That may work for one computer on a single world, but not all. With your approval though, I will edit that in, and credit you. As for test.txt, I don't think it can remove file extensions, and if it can, it's still easier to remove it while you put it in the folders, and it probably can't change it in the "global" folder, where all the computers can access it.
Mtdj2 #4
Posted 25 September 2012 - 04:53 PM
The computers can read any file extention. And an answer: Approved. And yes, you cant remove ROM from your computer in minecraft. Do it from the outside.
Mr. Fang #5
Posted 26 September 2012 - 12:21 AM
LOL you could just do some fs.delete or fs.copy…
abdul.ado #6
Posted 07 February 2013 - 01:05 AM
Hi there. I know this thread is a little old now but I'm trying to use an external text editor to write programs and I'm having issues trying to figure out where to save the files.

Everywhere i have looked on google has said the same place minecraft/mods/ComputerCraft/lua/rom/programs and I have looked in the mods directory but there is never a computer craft directory there, there is a zip file of the same name but no directory.

Has the latest version moved the directory somewhere else and does the location where I have to save the files change if I am playing on a dedicated server? I should probably mention that i am using the mindcrack pack from feed the beast

Im trying to write a script to build an underground mine cart network to get around the map without me having to do anything to it so the tiny little in game editor isnt going to cut it sadly.
Dlcruz129 #7
Posted 07 February 2013 - 04:20 AM
Hi there. I know this thread is a little old now but I'm trying to use an external text editor to write programs and I'm having issues trying to figure out where to save the files.

Everywhere i have looked on google has said the same place minecraft/mods/ComputerCraft/lua/rom/programs and I have looked in the mods directory but there is never a computer craft directory there, there is a zip file of the same name but no directory.

Has the latest version moved the directory somewhere else and does the location where I have to save the files change if I am playing on a dedicated server? I should probably mention that i am using the mindcrack pack from feed the beast

Im trying to write a script to build an underground mine cart network to get around the map without me having to do anything to it so the tiny little in game editor isnt going to cut it sadly.

You need to extract the zip, and make sure you name it "ComputerCraft", leaving the version number out.
abdul.ado #8
Posted 07 February 2013 - 03:44 PM
Thanks for your help, it pointed me in the right direction.

Just a few notes for anyone else having this issue that might find this
-if you want to use your program on the server the file has to be saved on the server.
-if you are using a linux server its case sensitive and the archive needs to be extracted to "ComputerCraft" not "computercraft"