ComputerCraft Forums

ComputerCraft => Programs => Turtle Programs => Topic started by: Lvl1Slime on May 05, 2021, 09:52 AM

Title: Best Mining Program
Post by: Lvl1Slime on May 05, 2021, 09:52 AM
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.
Title: Best Mining Program
Post by: Lvl1Slime on May 05, 2021, 09:56 AM
Example of program input
Title: Best Mining Program
Post by: Lvl1Slime on May 07, 2021, 12:55 AM
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.
Title: Best Mining Program
Post by: Twarx on Feb 03, 2022, 09:21 PM
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.
Title: Best Mining Program
Post by: slimpickins28 on Sep 03, 2023, 05:29 PM
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!
Title: Best Mining Program
Post by: SamH on Sep 11, 2023, 09:49 AM
Program looks cool but there are a few ways it could be improved.
Title: Best Mining Program
Post by: brattigo on Sep 09, 2024, 07:43 PM
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
Title: Best Mining Program
Post by: Missooni on Sep 10, 2024, 06:37 PM
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.
Title: Best Mining Program
Post by: Purrcival on Sep 10, 2024, 09:13 PM
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.
Title: Best Mining Program
Post by: BrianOG on Dec 12, 2024, 07:12 AM
(https://camo.tmpim.com/c4ecbc0e498e9c8888f91738607a3b3d6faa6414/68747470733a2f2f6779617a6f2e636f6d2f3162383231363632306330623735353764613437643264666461356536366134)

how do i fix this error?
Title: Best Mining Program
Post by: Ryuu_Balthazar on Dec 13, 2024, 10:14 AM
Quote from: BrianOG on Dec 12, 2024, 07:12 AM(https://camo.tmpim.com/c4ecbc0e498e9c8888f91738607a3b3d6faa6414/68747470733a2f2f6779617a6f2e636f6d2f3162383231363632306330623735353764613437643264666461356536366134)

how do i fix this error?
you have to put it in the 16th slot or the bottom right hand side of the inventory of the turtle, i'm pretty sure
Title: Best Mining Program
Post by: LeMarcel on Jan 20, 2025, 06:08 AM
Anyone solved the issue about it not mining all the way to bedrock??
Edit: I saw the code someone edited but idk how to apply it to my mining turtle

Title: Best Mining Program
Post by: Purrcival on Jan 22, 2025, 02:41 PM
Quote from: LeMarcel on Jan 20, 2025, 06:08 AMAnyone solved the issue about it not mining all the way to bedrock??
Edit: I saw the code someone edited but idk how to apply it to my mining turtle



Try using the wget command to get the file they edited. If it's pastebin, use the command for that instead. If this is a local world, you can access the code as a workspace from the world files using Notepad++ or VSCode.
Title: Best Mining Program
Post by: Sgn_Syndicate on Mar 22, 2025, 11:29 AM
I'm new to this mod so I googled mining turtle, I'm having issues where the turtle is mining the chunk but its only mining every other layer and throwing items on the floor. where did I mess up.