Turtle/computercraft

  • 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

zaekeon

New Member
Jul 29, 2019
135
0
0
What are some of the best/popular sites to check out example scripts people have made with CC and turtles?
 

Yusunoha

New Member
Jul 29, 2019
6,440
-4
0
I wish there was a program for LUA noobs that would basically help you with writing programs, where you could say what you want to do and the program writes the codes, but that kind of program is probably impossible.
like I'd love for a turtle to mine 1 certain block above surface, like if you'd tell the turtle to mine basalt, and you place it at a volcano, it'll mine all the basalt it can detect.
 

jnads

New Member
Jul 29, 2019
248
0
0
I wish there was a program for LUA noobs that would basically help you with writing programs, where you could say what you want to do and the program writes the codes, but that kind of program is probably impossible.
like I'd love for a turtle to mine 1 certain block above surface, like if you'd tell the turtle to mine basalt, and you place it at a volcano, it'll mine all the basalt it can detect.
Go learn to program.

Seriously, the one reason ComputerCraft Turtles are not OP is because it takes so long to write a proper program.

There is actually a mechanism that allows you to do what you're asking. A turtle can compare a block in front of it to what it has in its inventory. Set turtle, give it 1 basalt, and write a program that says "mine more of this".

If you don't want to jump in the pool, at least help clean it. There's tons of programs on the ComputerCraft forums. Find one and modify it to do what you want.
 

Watchful11

Forum Addict
Team Member
Third Party Pack Admin
Nov 6, 2012
3,031
1,351
188
Go learn to program.

Seriously, the one reason ComputerCraft Turtles are not OP is because it takes so long to write a proper program.
Exactly that. I don't want to seem rude, but Turtles can be incredibly OP if you know how to code. If I just released my super quarry program with a few instructions then people could get one mining turtle, a couple saplings and some blaze rods, then sit back and watch them eat the whole world.

That said, there are places, the best one is the computercraft forum, that can help you with the basics.
 

jnads

New Member
Jul 29, 2019
248
0
0
Exactly that. I don't want to seem rude, but Turtles can be incredibly OP if you know how to code. If I just released my super quarry program with a few instructions then people could get one mining turtle, a couple saplings and some blaze rods, then sit back and watch them eat the whole world.

That said, there are places, the best one is the computercraft forum, that can help you with the basics.
Yup.

Someone had a video on the CC forums, comparing the speed of a Quarry with a Turtle that would mine every 3rd layer, and if it found something other than stone, it would mine it.

The Turtle beat the Quarry.


With the new MiscPeripherals ChunkLoader add-on, there's 0 reason to use a Quarry.


 

KirinDave

New Member
Jul 29, 2019
3,086
0
0
Go learn to program.

Seriously, the one reason ComputerCraft Turtles are not OP is because it takes so long to write a proper program.

Actually, their they're (ed., curse you, Android tablet completion!) carefully balanced to set my brain on fire and make my eyes leak rage lava. I googled around for a popular turtle quarry program to see what CC Lua looked like. I found this and wept blood. I punched the wall and cried about coroutines incoherently for about 20 minutes.

Oh the humanity. Oh the tragedy. Truly, Turing is turning in his grave with such force as to provide infinite electricity for all.

And also CC turtles would be way less OP if they were more expensive. They're awesome in principle. In practice they're cheaper than every alternative and just not that that hard to write simple scripts in.
 

jnads

New Member
Jul 29, 2019
248
0
0
Actually, their carefully balanced to set my brain on fire and make my eyes leak rage lava. I googled around for a popular turtle quarry program to see what CC Lua looked like. I found this and wept blood. I punched the wall and cried about coroutines incoherently for about 20 minutes.

Oh the humanity. Oh the tragedy. Truly, Turing is turning in his grave with such force as to provide infinite electricity for all.
Lua is not that bad. I've written in much worse languages.

Yeah, Lua is weakly-typed, but that makes it easy to use (and hard to debug).


And for a mining turtle you still need 3 diamonds for a pickaxe. A Quarry needs, what, 8? And some gold (gold is like water in MindCrack). Oh the humanity!
 

ItharianEngineering

New Member
Jul 29, 2019
473
0
0
Well really with redpower you can just use a gem pickaxe, though you can't get obsidian, it makes it even easier to get. Also the quarry needs 11 diamonds, plus a ton of power compared to the amount the turtles use, though I hear the fuel usage was increased recently.
 

KirinDave

New Member
Jul 29, 2019
3,086
0
0
Lua is not that bad. I've written in much worse languages.

Lua is awkward, but has some nice features. I'm more saying that this is the state of the community; basically everyone is doing with turtles on minecraft what I did with turtles on an Apple ][ and that makes me sad. I tried to find a single library that even thought of using a corotuine-based generator for pathfinding to radically shorten the code; they didn't. :(

It's supposed to be 2013. The kids are supposed to be allright!

And for a mining turtle you still need 3 diamonds for a pickaxe. A Quarry needs, what, 8? And some gold (gold is like water in MindCrack). Oh the humanity!

Quarries take 11 diamonds now. 3 for a pickaxe, 8 for the gears. And a bunch of gold.
 

jnads

New Member
Jul 29, 2019
248
0
0
Well really with redpower you can just use a gem pickaxe, though you can't get obsidian, it makes it even easier to get. Also the quarry needs 11 diamonds, plus a ton of power compared to the amount the turtles use, though I hear the fuel usage was increased recently.
Well, the advantage with Turtles, is they eventually hit coal, and can refuel themselves.

I will admit, sharing on the internet makes Turtles somewhat OP.

But I don't see the difference between someone who spends 40-80 hours making a well-refined Quarry program, and someone who spends 40-80 hours getting a Fusion Generator and a Matter Fabricator with GregTech.
 

jnads

New Member
Jul 29, 2019
248
0
0
Lua is awkward, but has some nice features. I'm more saying that this is the state of the community; basically everyone is doing with turtles on minecraft what I did with turtles on an Apple ][ and that makes me sad. I tried to find a single library that even thought of using a corotuine-based generator for pathfinding to radically shorten the code; they didn't. :(
A coroutine-based pathfinding generator (I assume you mean for returning to a chest the way you came, or vice versa), is do-able, but in a simple mining program, you don't really have a clearly defined producer/consumer.

And I assume Lua was chosen because it was the quickest thing they could grab that had a moderately simple complexity and had a readily-available open-source Java interpreter available.

Keep in mind ComputerCraft has only been out for about a year. And a lot of the APIs to do the juicy stuff have been more recent. I did see finally someone made an Octree library:

http://www.computercraft.info/forum...fficient-way-of-storing-and-querying-3d-data/
 

KirinDave

New Member
Jul 29, 2019
3,086
0
0
A coroutine-based pathfinding generator (I assume you mean for returning to a chest the way you came, or vice versa), is do-able, but in a simple mining program, you don't really have a clearly defined producer/consumer.

Sure you do. The consumer is the action loop selecting from one of a variety of actions based on the current state of the turtle. If it's full or low on fuel, take an action from the "goHome" generator.

Coroutines are a great way to capture stepwise execution of a process best described as a loop and "invert" the invocation of it. It's also good for taking stepwise computations and turning them into a stream.

Keep in mind ComputerCraft has only been out for about a year. And a lot of the APIs to do the juicy stuff have been more recent. I did see finally someone made an Octree library:

http://www.computercraft.info/forum...fficient-way-of-storing-and-querying-3d-data/

Thank you, that is cool. Maybe there is hope for the world.
 

jnads

New Member
Jul 29, 2019
248
0
0
Sure you do. The consumer is the action loop selecting from one of a variety of actions based on the current state of the turtle. If it's full or low on fuel, take an action from the "goHome" generator.

Coroutines are a great way to capture stepwise execution of a process best described as a loop and "invert" the invocation of it. It's also good for taking stepwise computations and turning them into a stream.

Thank you, that is cool. Maybe there is hope for the world.
Perhaps if you had a more complicated program that did animal breeding, beekeeping, or farming, but for a Quarry that seems like overkill. Really, for mining, you have two choices: Choose a direction to move, and dig then move, or go home (for whatever reason, fuel, inventory full, etc).

But yeah, glad to find the octree program. Should make gps-less navigation much easier (specifically the return home part.... mine in a random direction, following the ores, then return home).


Mining Turtles w/ Wireless Chunkloader modules are the new undiscovered source of ultimate OP! Nether Lava, be afraid!
 

KirinDave

New Member
Jul 29, 2019
3,086
0
0
Perhaps if you had a more complicated program that did animal breeding, beekeeping, or farming, but for a Quarry that seems like overkill. Really, for mining, you have two choices: Choose a direction to move, and dig then move, or go home (for whatever reason, fuel, inventory full, etc).

But yeah, glad to find the octree program. Should make gps-less navigation much easier (specifically the return home part.... mine in a random direction, following the ores, then return home).

Mining is the easiest case. The "goHome()" generator is a generator that given the current location computes a direction to go to reach ome, or "none". You can then just loop on the output of the generator. Coroutines make simple code cleaner, and complicated code more approachable. They are not for "complex" things, because they themselves are not complex.

In a pure quarry where you are raking everything down to the bedrock into a chest, that's overkill. For a branch mining program where you maintain your path as a stack it's exactly what you want.
 

jnads

New Member
Jul 29, 2019
248
0
0
In a pure quarry where you are raking everything down to the bedrock into a chest, that's overkill. For a branch mining program where you maintain your path as a stack it's exactly what you want.
That was my point. A Diamond hunting turtle (and maybe Thaumcraft Shards).
 

KirinDave

New Member
Jul 29, 2019
3,086
0
0
That was my point. A Diamond hunting turtle (and maybe Thaumcraft Shards).

Yeah, although the best quarry programs I have seen actually don't strip the world. They actually dig 1/3 of all noise blocks looking for work.
 

Abdiel

New Member
Jul 29, 2019
1,062
0
0
If I were to write a mining turtle, my first priority would be detecting and avoiding blocks that can be silk touched or fortuned (coal, diamonds, redstone, gems, etc.) Let the turtle dig branch mine tunnels for you and deposit all the iron/gold/copper/etc., then you come with a ST pickaxe and get the good stuff to your macerators/grinders.
 

jnads

New Member
Jul 29, 2019
248
0
0
If I were to write a mining turtle, my first priority would be detecting and avoiding blocks that can be silk touched or fortuned (coal, diamonds, redstone, gems, etc.) Let the turtle dig branch mine tunnels for you and deposit all the iron/gold/copper/etc., then you come with a ST pickaxe and get the good stuff to your macerators/grinders.
When you have 14 trillion chunks in a Minecraft world, does it matter if you only get 14 trillion diamond and not 28 trillion diamond? For reference, that's 2 billion diamond chests full of diamond blocks.

Automated mining chunkloader turtle.