Main Menu

Best Mining Program

Started by Lvl1Slime, May 05, 2021, 09:52 AM

Previous topic - Next topic
Pastebin bkL6gaRv

Features:
Advanced filter, you can either have a whitelist where it will only mine blocks placed in the first 14 slots OR a blacklist where it will avoid blocks placed in the first 15 slots. For the blacklist, it will place the filter blocks back in the starting chest for use with other turtles and to avoid clutter.
Customizable mining area, it will dig down to bedrock and then mine out an area that you can configure the length, width, and height of. You can also have it not dig all the way down by lieing to it about the starting Y level.
Memory, the turtle will return to the chest once its inventory is full and deposit items before returning to where it was
Never run out of fuel underground, the turtle checks if it has enough fuel to keep going, and if it does not it will pause and return to surface, where you can give it more fuel and then it will resume.

To use:
1. Place mining turtle
3. Place a chest (best to use like a diamond chest or double chest unless you're using the whitelist setting)
2. type pastebin get bkL6gaRv name
3. type name
4. it will ask for length and width, put in desired size to dig
5. it will ask for a starting Y value, just put in whatever f3 says
6. it will ask if you want a whitelist, yes = whitelist, no = blacklist
7. it will ask if you want to dig the entire chunk, yes/no. If you answer yes, the program will commence mining and will dig from the starting point down to bedrock. If you answer no, it will ask how many levels you want to mine. It will dig from bedrock up to the input y-level.
8. Profit $$$

If you find a bug I'll probably fix it.

Example of program input

Fixed issue where running whitelist with multiple items would dispose of items on the white list in addition to everything else. Also made whitelist and chunk questions both accept y, Y, n, N, yes, Yes, no, No.

Twarx

#3
It doesn't work if there is bedrock front of it or below it. Like in my modpack there is Y5 the starting level for bedrocks. I don't know how could I solve it.

I had to stop the mining turtle just a little after it started.  Its now always saying "Output Inventory Not Found".  i even deleted and re-added the quarry program.  same thing.  Even when trying to start a quarry that is 1 1 1. 

BTW, the other turtle is working just fine and love the program you made!

SamH

Program looks cool but there are a few ways it could be improved.
  • Since 1.18 bedrock now generates at -64.
  • Since 1.18 different ores generate at different Y levels
    . However, mining at Y0 will still get you a good collection of ores.
  • Some turtles are wireless, so adding gps support would be cool.
  • Automatically placing torches would be helpful if you need to go down, so you don't get attacked by a load of mobs.
  • You could create a "server" program which receives messages from the turtle about what it is doing. This can be done with rednet.

brattigo

Anyone know what i need to change in the code to get it past layer 0? It's an amazing program but i don't see a use for it if it can't quarry past 0

Missooni

Quote from: brattigo on Sep 09, 2024, 07:43 PMAnyone know what i need to change in the code to get it past layer 0? It's an amazing program but i don't see a use for it if it can't quarry past 0
Was a little confusing to look at considering this program refers to the Y axis as the Z axis at times but I checked this out today for you. You don't actually need to change any of the code to get it to mine past layer 0, but it would make it easier.

Right now the code works like this:
Solution 1
If you select 'dig entire chunk' it will take the current Y level of the turtle and dig down that many blocks, minus 3, ending up at y = 3. For example, setting it to Y=51, 'quarry entire chunk' will make it dig down 48 blocks until it reaches Y = 3.

You can specify how many blocks to dig down, but if you set the turtle's accurate Y level and then ask it to dig down 160 blocks, it will dig down to Y = 3 and then rise 60 blocks into the air. I was able to get it to dig past 0 by setting the Y level to the turtle's current Y level, plus however many blocks extra.

It always tries to remove 3 from the final destination though, to accommodate for bedrock irregularity. So, if your turtle is at Y=70, and you want it to dig to -130, enter '103' as the turtle's Y level.
Now, if you'd still like to edit this code so that you don't need to do additional math every time you want the turtle to mine a quarry:
Solution 2
Code: Lua
  1. print("Do you want to dig the whole chunk, y/n?")
  2. local dummy = io.read()
  3. if dummy == "n" or dummy == "N" or dummy == "no" or dummy == "No" then
  4.     print("Layers to dig?")
  5.     fin = tonumber(io.read())
  6. else fin = z0 end
This is the area where the user decides how many layers should be mined. If you edit the 'else' statement like so:
Code: Lua
  1. else
  2. z0 = z0+62
  3. fin = z0
  4. end
The turtle will dig down to bedrock at -159 when the user specifies 'dig entire chunk'.
Hope this can help you out.
" We are like the spider. We weave our life and then move along in it.
We are like the dreamer, who dreams and then lives in the dream. "
- Aitareya Upanishad

QuickMuffin8782

Quote from: Missooni on Sep 10, 2024, 06:37 PM-formatting snip-
Quote from: brattigo on Sep 09, 2024, 07:43 PM-formatting snip-
Yes, although the quarry size is now different in depth, you can also get it to detect bedrock, so you don't have to get the whole turtle confused on where to go and you having to debug the damn program. You can utilize JackMackWindows' PrimeUI for visual interface.
"The Blue Blur" - Working on Net Star OS, a new frontier for Red Star OS 3.0
linktr.ee/quickmuffin8782