Hello,
So I have tried to copy paste the code
while true do
turtle.attack()
end
but it only pastes
while true d
and when I try to enter the rest of it after pressing enter is says no such program.
What am I doing wrong.
Please help I really do not feel like hearing things like go play something else or random insults. If you don't have any advise please do not say anything at all. I need help with this.
Thank you
You can find the programs from the turtle's drive stored in a folder in the world's save folder.
If you are using a Feed The Beast mod pack then finding the save folder is easy:
- Click on the button above the list of packs labelled "Edit Mod Pack" and in the window click the button labelled "Open Folder" under the list of mods. This will open Windows Explorer at the location for the mods in the pack.
- Go up one folder level and you should see a folder called "saves". Open that and then open the folder with the same name as your world.
- Now you should see a folder called "computer", open that and you will find one or more folders as just a number, starting at 0. These are the disk drives for the computers and turtles you have in the world.
- You will have to figure out which one is for the turtle you are using but once you find it any programs you have in the turtle are stored in that folder. They are plain text files and can be edited with any text editor like Notepad. Editing this way allows full cut'n'paste and you can edit the files while Minecraft is still running, the Computer/Turtle will register the changes the next time the edited program is run.
If you are using some other mod pack loader or a custom mod pack of your own creation then you may have to search for your saves folder. The default place for vanilla Minecraft is in %APPDATA%\.minecraft\saves\ (just enter that into Windows Explorer and it will take you there, unless you manually changed the location like I do with mine!)
A tip for making sure a computer or turtle always references the same numbered folder no matter how many times you dig it up then place it is to label the computer or turtle. At the computer or turtle's prompt just type "label set [name]" (without the quotes or square brackets of course). Without this being done every time you dig up your turtle or computer then place it down again it will create a new numbered folder in that computer folder without the files you previously had.
I prefer to edit my ComputerCraft programs this way as I have a programmer's editor that can do command colouring for Lua scripts. Plus editing this way is far more responsive than the built in editor in ComputerCraft as your PC is far faster at responding to keypresses and being able to cut'n'paste blocks of code makes creating similar functions a lot quicker!