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

Basic turtle coding questions that no one answers

Started by Shaard, 02 April 2013 - 06:08 PM
Shaard #1
Posted 02 April 2013 - 08:08 PM
So I discovered turtles a few days ago on tekkit, and I've been loving using the basic tunnel and excavate commands.

However, I wanted to write code of my own, so I looked into google and came across this forum. However, upon attempting to learn lua, I ran into a few issues that I haven't been able to resolve regardless of using the search function or scouring tutorials over the web:

NOTE: I'm playing on a multiplayer server with Computercraft 1.33 (via tekkit)

1) People often mention using a computer to wirelessly control the turtle, but I have yet to see a single explanation of how to connect to the turtle from the computer

2) Upon writing code on the turtle, if I pick up the turtle and move it, all my code is deleted. Is there a way to actually keep the code and not have to write it over and over again per use?

3) I see a lot of codes in the rom folder under /computercraft/ and after removing and picking up the turtle they are always still there. However, all the codes in the folder are just "File" files (as opposed to "Text Document" or such) is there a specific writer I need to use to export as just "File"s

4) Adding to the last quesiton, is there any way to write code outside of the computer/turtle GUI and then implement it on my turtles without having to do the whole 'pastebin get …' stuff?

5) My turtle has only 9 spots, as opposed to the 16 EVERYONE else has in videos. Is this because I'm running 1.33 and not 1.4+?

6) Is there ANY tutorials on basics of writing and using lua that isn't just "This is an if statement, this is a variable. Good luck."? Something like "If you save your program and later use it again this happens. Programs are saved here, but you can access them later…" etc. I haven't seen a single tutorial that actually goes into handling turtles that doesn't look like a Computers 101 class =/
theoriginalbit #2
Posted 02 April 2013 - 08:17 PM
1) People often mention using a computer to wirelessly control the turtle, but I have yet to see a single explanation of how to connect to the turtle from the computer
This is because you have to make a program to do so… there are a few that do this, I also have been working on one for a while… but there is no way to do this by default…

2) Upon writing code on the turtle, if I pick up the turtle and move it, all my code is deleted. Is there a way to actually keep the code and not have to write it over and over again per use?
You will also find that you loose all the fuel too. If you label the turtle fuel and programs will remain. the same applies for computers, if you label them the programs will stay. to label a computer type the following into the computer/turtle
label set <some-label>
where <some-label> is what you wish it to be called

3) I see a lot of codes in the rom folder under /computercraft/ and after removing and picking up the turtle they are always still there. However, all the codes in the folder are just "File" files (as opposed to "Text Document" or such) is there a specific writer I need to use to export as just "File"s
I'm not quite too sure what you mean, but here goes… these files are Lua source files. they have no extension, you can open them with text editors such as Sublime Text 2, NotePad++ or others. when making your own programs just save the file without an extension. you can put a .lua extension on it if you wish, but you will have to remember that when you are trying to run the program you also need to type .lua

4) Adding to the last quesiton, is there any way to write code outside of the computer/turtle GUI and then implement it on my turtles without having to do the whole 'pastebin get …' stuff?
Yes there is, if you navigate to the 'saves' folder of the Tekkit world you can directly edit the files in 'computer/<id>' where id is the <id> of the computer or turtle… if you do not have access to the server files then no you cannot, you will just have to use paste bin…

5) My turtle has only 9 spots, as opposed to the 16 EVERYONE else has in videos. Is this because I'm running 1.33 and not 1.4+?
that is correct… stupid Tekkit… it also means you are missing a few other things that most people have too :(/>

6) Is there ANY tutorials on basics of writing and using lua that isn't just "This is an if statement, this is a variable. Good luck."? Something like "If you save your program and later use it again this happens. Programs are saved here, but you can access them later…" etc. I haven't seen a single tutorial that actually goes into handling turtles that doesn't look like a Computers 101 class =/
Take a look at the 'Tutorials' section on these forums… also take a look at the ComputerCraft wiki, there can be some good info on there… also if you wish to learn Lua better, nothing beats the PIL
Ray_Anor #3
Posted 02 April 2013 - 08:26 PM
1) People often mention using a computer to wirelessly control the turtle, but I have yet to see a single explanation of how to connect to the turtle from the computer
look at Wiki rednet API closely
2) Upon writing code on the turtle, if I pick up the turtle and move it, all my code is deleted. Is there a way to actually keep the code and not have to write it over and over again per use?
If in creative mode - it's destroy turtle. Set label to you turtle: os.SetComputerLabel(string name)
All your programs may be finded in .minecraft\saves\<world name>\computer

3) I see a lot of codes in the rom folder under /computercraft/ and after removing and picking up the turtle they are always still there. However, all the codes in the folder are just "File" files (as opposed to "Text Document" or such) is there a specific writer I need to use to export as just "File"s
There are you had seen basic preinstalled complect.

4) Adding to the last quesiton, is there any way to write code outside of the computer/turtle GUI and then implement it on my turtles without having to do the whole 'pastebin get …' stuff?
when you want - you may use Notepad++ . All of your codes you may find in .minecraft\saves\<world name>\computer

5) My turtle has only 9 spots, as opposed to the 16 EVERYONE else has in videos. Is this because I'm running 1.33 and not 1.4+?
YES

6) Is there ANY tutorials on basics of writing and using lua that isn't just "This is an if statement, this is a variable. Good luck."? Something like "If you save your program and later use it again this happens. Programs are saved here, but you can access them later…" etc. I haven't seen a single tutorial that actually goes into handling turtles that doesn't look like a Computers 101 class =/
Try find on youtube. Read wiki. Look at other samples.
theoriginalbit #4
Posted 02 April 2013 - 08:29 PM
If in creative mode - it's destroy turtle. Set label to you turtle: os.SetComputerLabel(string name)
@Ray_Anor you have a capital S there, that would be an error

just an FYI to OP using os.setComputerLabel is through code ONLY… to do it easier just use the label program…
Shaard #5
Posted 02 April 2013 - 08:34 PM
Thank you very much for the help. =3

I'll dabble a bit with the advice given here and see if I can solve some of my problems.
Ray_Anor #6
Posted 02 April 2013 - 08:59 PM
If in creative mode - it's destroy turtle. Set label to you turtle: os.SetComputerLabel(string name)
@Ray_Anor you have a capital S there, that would be an error

just an FYI to OP using os.setComputerLabel is through code ONLY… to do it easier just use the label program…

:)/> really capital - don't work, must setComputerLabel… My fault, cause programming in many languages.
theoriginalbit #7
Posted 02 April 2013 - 09:02 PM
:)/> really capital - don't work, must setComputerLabel… My fault, cause programming in many languages.
yes really… I program in heaps of different languages too, you need to learn to separate them somehow in your mind so you don't cross syntaxes…