Turtles

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

RetroGamer1224

New Member
Jul 29, 2019
716
0
0
So I tried my first mining turtle last night on a SMP server. Had major fun seeing how the simple excavate program really did a good job. What I am wondering is did anyone jump straight into doing their own coding for digging or use a program already written up? Was it hard to jump into the programming?
Thanks
 

Captain Neckbeard

New Member
Jul 29, 2019
214
0
0
VGToolbox has some great Computercraft tutorials on Youtube. You get some laughs in there so you're not overwhelmed all at once, and can easily learn (long-term, even) the basics of coding in a few hours. You'll accidentally destroy the world with self-replicating miners inside a week.
 

RetroGamer1224

New Member
Jul 29, 2019
716
0
0
LOL I think my friend would hang me if I did that. Still from Y64 to bedrock in about six minutes is awesome. Ty for the youtuber, it has been many years since I touched any kind of code.
 

Vircomore

New Member
Jul 29, 2019
61
0
0
When I started looking into coding turtles, I did my own program first (which was rather challenging) rather than copying people's programs from the web.

Here's a suggestion though if you want to learn to code:

1. Start a singleplayer world (in creative if you want).
2. When you create a new turtle program, it gets saved into your "saves"-->(name)-->"computercraft"-->(find the folder with your turtle program in it)
3. This way, you can edit your turtle code in Notepad instead of having to sit in-game and try and work with the turtle screen.

Then when you have something good - upload it to Pastebin and then you can get on your friend's server (if he has file download enabled) and download your program to your multiplayer turtle.
 

Poppycocks

New Member
Jul 29, 2019
1,914
0
0
When I started looking into coding turtles, I did my own program first (which was rather challenging) rather than copying people's programs from the web.

Here's a suggestion though if you want to learn to code:

1. Start a singleplayer world (in creative if you want).
2. When you create a new turtle program, it gets saved into your "saves"-->(name)-->"computercraft"-->(find the folder with your turtle program in it)
3. This way, you can edit your turtle code in Notepad instead of having to sit in-game and try and work with the turtle screen.

Then when you have something good - upload it to Pastebin and then you can get on your friend's server (if he has file download enabled) and download your program to your multiplayer turtle.
Notepad++ for lua markup :).
 

cynric

New Member
Jul 29, 2019
189
0
0
2 tips I read somewhere on these forums that made my first steps with turtles way less annoying:
give your tutle a name: "label set <name>" ... that way, the programs in the turtle (and the fuel amount in it) will survive picking up the turtle
"refuel all" will refuel the internal fuel storage of the turtle with everything usable in the turtles inventory ... dump a few stacks of coal in there and you won't run out all the time
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
So I tried my first mining turtle last night on a SMP server. Had major fun seeing how the simple excavate program really did a good job. What I am wondering is did anyone jump straight into doing their own coding for digging or use a program already written up? Was it hard to jump into the programming?
Thanks

I have been programming Java since '98 so as an experienced programmer learning another language is no big deal. I can understand however that it's rather daunting if you have no programming experience. Fortunately both LUA and how CC presents turtles is very beginner friendly. Pretty much anyone can figure out what "turtle.dig()" and "turtle.forward()" does. Only when you start on stuff like loops and functions it gets a bit more complex (and for someone used to Java having the order or functions matter is rather 'new' too ;)).

Notepad++ for lua markup :).

I'd like to second, third and fourth that. Syntax highlighting makes code much more readable.
 

Poppycocks

New Member
Jul 29, 2019
1,914
0
0
Real Men Use Emacs.
real_programmers.png
 

RetroGamer1224

New Member
Jul 29, 2019
716
0
0
You all are so awesome! I didn't know about the notepad use so I will get some program to help. I am excited because I haven't coded in about ten or so years...gods I am old...
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
The computercraft.info forum is good for help in learing lua. I've written a couple of programs myself, but I admit that the two that I use the most are other people's advanced mining and logging programs. I feel a bit guilty about that, I should have written my own.
 

RetroGamer1224

New Member
Jul 29, 2019
716
0
0
The forum had a great video of someone who did a cool logging turtle. For now I will use my survival world turtle to excavate a few places to see what I get. Also need to make a solid village breeding system.
 

Poppycocks

New Member
Jul 29, 2019
1,914
0
0
Gah, what I honestly hate about turtles is that they don't even know which way they're facing. Honestly if greg decided that he wants his own turtles, for which you have to shoot three satelites into space first and use miniature black holes and gravitation engines as a part of the recipe, but which could switch between tools, know where they are and which direction they're facing, then I'd use those and never look back.
 

Guswut

New Member
Jul 29, 2019
2,152
0
0
Vim > notepad, ++ or otherwise


Hahahahahahahahah! You are one funny person.

~~~

Gah, what I honestly hate about turtles is that they don't even know which way they're facing. Honestly if greg decided that he wants his own turtles, for which you have to shoot three satelites into space first and use miniature black holes and gravitation engines as a part of the recipe, but which could switch between tools, know where they are and which direction they're facing, then I'd use those and never look back.

It is actually fairly logical that they don't know which way they are facing. And isn't there a compassTurtle from one of the ComputerCraft addons installed with most FTB packs?

Besides that, though, if you need to know their facing, you should just code in a way to record the facing. When you place the turtle, record the facing direction in a file. From there, make a new function for turnLeft and turnRight so that whenever they turn, they update their current facing direction. That way, any program can pull the facing, and so long as all of your programs have the new turnLeft and turnRight functions in them and use them, you'll always have an accurate facing recorded.
 

slay_mithos

New Member
Jul 29, 2019
1,288
0
0
I personally use SciTE for that, but that is basically the same as Notepad++.

Even with color computers, it is a pain to code in those, you don't see much at once and indentation is not that great.

I know that Direwolf20 tried to make a beginner tutorial on how to code for ComputerCraft too, even if it's not as advanced as what was mentionned above.
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
Besides that, though, if you need to know their facing, you should just code in a way to record the facing. When you place the turtle, record the facing direction in a file. From there, make a new function for turnLeft and turnRight so that whenever they turn, they update their current facing direction. That way, any program can pull the facing, and so long as all of your programs have the new turnLeft and turnRight functions in them and use them, you'll always have an accurate facing recorded.

And if you also keep track the number of blocks they moved you can quite easily program a turtle that can move back to it's original location.
 

Guswut

New Member
Jul 29, 2019
2,152
0
0
And if you also keep track the number of blocks they moved you can quite easily program a turtle that can move back to it's original location.

Yup, that would be the logical extension of that, which would then allow you to keep your exact location (x/y/z) stored as well. Just make sure to have error handling (if you don't move when trying to move forward), and you would be good to go.
 

Poppycocks

New Member
Jul 29, 2019
1,914
0
0
Hahahahahahahahah! You are one funny person.

~~~



It is actually fairly logical that they don't know which way they are facing. And isn't there a compassTurtle from one of the ComputerCraft addons installed with most FTB packs?

Besides that, though, if you need to know their facing, you should just code in a way to record the facing. When you place the turtle, record the facing direction in a file. From there, make a new function for turnLeft and turnRight so that whenever they turn, they update their current facing direction. That way, any program can pull the facing, and so long as all of your programs have the new turnLeft and turnRight functions in them and use them, you'll always have an accurate facing recorded.
Yeah and save it in a file, right?

Eh, I made a gps tover just to avoid that.

Rarrr. SATELITES.