r/ComputerCraft • • Sep 21 '22

Computer Craft Quarry

Lua program to mine quarry of equal length and breadth.

pastebin get qLNTfKvM <file name>

Usage: <file name> <size> <depth>

Features -

  1. Efficient mining algorithm

  2. Refueling system which conserves fuel by consuming minimum fuel.

  3. Drops items in chest when inventory is full.

  4. Gravel friendly

  5. Returns back when done mining.

  6. Gives useful info about the mining process. eg - fuel level, levels digged, etc.

32 Upvotes

7 comments sorted by

1

u/devsmash1 Oct 02 '22

doesn't check if inventory is full on each digging step so it can lead to ores despawning because the inventory becomes full mid-level

1

u/[deleted] Oct 05 '22

You can change the value in line 222 (if emptySlots() == 0 then) to values from 1 - 15. This will tell the turtle to return to surface when 1 - 15 slots are empty. Note that putting value of 16 or above will break the program as the turtle needs at least 1 slot to store items.

1

u/devsmash1 Oct 05 '22

That's not the issue - it goes through a digging loop for each level and doesn't check the inventory each time it breaks a block or digs a line, so the inventory gets full until it finishes the entire Y level

1

u/[deleted] Oct 06 '22

You can calculate the number of empty slots per y level like this

{16 - [(size * size * 3)/64]}. if size is 16, it will have 4 empty slots. So you can do (if emptySlots() <= 4 then). If the size is too big then consider using 2 or more turtles.

2

u/danielepote Sep 24 '22

Excellent program, testing rn.

1

u/Affectionate-Cream26 Feb 12 '25

What do you mean by <size> <depth>? How can I make it mine, for example, a 16x16 hole all the way to bedrock?

1

u/Silent-Dependent3421 Sep 15 '26

Are you being serious? lol