r/ComputerCraft • u/Miro2023 • Sep 27 '24
Auto Mining turtle program
Hello i recently found out about mining turtles and that it's programmable but I couldn't find a fully automated mining turtle like a turtle that mines a column to bedrock comes back deposits the materials then mines a few blocks forward and mines to bedrock again and it's stops it's program and comes back either if it's runs out of fuel or gets manual stopped or the chest and inventory of the turtle is full is that a program that's out there? Is that even possible? I don't know anything about coding unfortunately
2
Upvotes
6
u/Bright-Historian-216 Sep 27 '24
Well you better start learning to code because the only limitations are your abilities and imagination
3
u/fatboychummy Sep 27 '24
If you're just looking for programs, I have two:
SimplifyDigging
https://github.com/Fatboychummy-CC/SimplifyDigging
This one is not super polished and only a chunk of it works (specifically the
quarryandroomsubcommands), but I use it for most of my "large" digging tasks. As the name suggests, I had planned a lot more to make it more user friendly, but never got to implementing a lot of things. Fuel checking, for one, was one of the things I planned, but unfortunately never worked on.However, it will refuel itself from anything it finds on the way down (coal and the like) if you tell it to, so fuel can become less of an issue. I usually just spam lava buckets into my turtles though personally.
The turtle will also return if its inventory is full, or if it runs into a block it cannot mine.
The final "good" thing about it is that it mines in layers of 3, making use of
turtle.digUpandturtle.digDownto be 3x more fuel efficient than the builtin "just dig in front of the turtle" style program.I never got around to writing official usage instructions on the repo, but you can see how to use it in the comment at the very top of the program.
... And now I want to redo this program again.
Dog
https://github.com/Fatboychummy-CC/Dog
This program utilizes block scanner peripherals (tested using Plethora's Block Scanner and Advanced Peripherals' Geoscanner) to detect ores nearby (8 blocks range usually), and will dig directly to them. If it sees no ore, it mines in a straight line downwards until it detects an ore within range. Dog is incredibly useful for getting a decent amount of rare resources fairly quickly, as you don't need to wait for the turtle to quarry an entire area, instead it paths directly to the ores.
Dog, unlike the other program I linked above, is a lot more polished. It has low fuel detection, bedrock detection, and will also return home if it throws an error (so it doesn't get stuck underground). The only issue is it requires chunkloading (as with most CC turtle programs). I do plan to (someday, maybe years from now, but someday) add unload-recovery to it as well, but currentlt if its chunk is unloaded it will get stuck underground.
1
u/LionZ_RDS Sep 27 '24
It’s mostly possible
It can’t come back if it’s out of fuel cause it can’t move so you would need to keep track of how many blocks it would need to move to get back, then if the fuel is equal to how many blocks you have to move it would come back
1
u/Spacedestructor Sep 28 '24
For Beginners the Language used is a custom implementation of Lua but the Official Documentation still aplies to 99% unless you do something very specific or nieche things a beginner wont be able to do: https://www.lua.org/manual/5.4/
secondly, you can (assuming its computercraft tweaked) look here: https://tweaked.cc/ to learn how to tell a turtle to "look", "turtle.detectDown()" for example will output some information about the block directly below it, which you can then compare if the blocks ID is "minecraft:bedrock", if no then go down until it is and if yes get it in a loop of going up.
Its a little extra work but the website has a tutorial on how to setup a GPS system https://tweaked.cc/guide/gps_setup.html which you can use when returning up after having reached bedrock to check on what Y level the turtle is and have it move up until it has reached your desired height.
Generally speaking something like digg straight down and return to a location to dump mined blocks is easier if the turtle knows where it is so you can always validate if the move you want to make is valid and when you move on to the next colum it still knows where to return to the chest or whatever inventory it dumps in to because you can just tell it to what coordinate to move to.
Fortunately what your desiring here for mining is relatively easy to implement as a beginners project if you can resist over engineering it, if you encounter any issues just halt the turtle and learn how to fix the problem.
That way you can avoid spending more time learning then playing and over iterations slowly learn more.
Also means you dont have to solve problems you dont actually have.
I know there are also already some mining related projects online available if you search for them, so you can look what they did and see if there is something you can copy and experiment with to adjust it to your needs.