This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DashMagic's profile picture

How can I make my turtle tunnel-digger more efficient?

Started by DashMagic, 27 August 2013 - 05:47 PM
DashMagic #1
Posted 27 August 2013 - 07:47 PM
Title: How can I make my turtle tunnel-digger more efficient?

Here is my code: http://pastebin.com/XCjtyr04

Anyways, currently this makes a turtle dig a tunnel. Thing is… it's really inefficient. For example, the turtle goes from the bottom left up to the height of the tunnel, then back down, and to the right. It does this for the whole width, and then goes back all the way to the left to do the exact same thing again, just 1 deeper.

Here's a visual: http://i.imgur.com/64J4cfI.png

So essentially it goes up * height, down * height, right 1, repeat.
It would be way better to go up height, right, down height, right, repeat. However I don't know how to do that.

This also works for the depth too, it goes all the way to the original starting position, just one block deeper. If I could just have it stay on the right side and work from right to left instead it wouldn't waste that pointless time and fuel.

I'm not all that good, what can I do to make this more efficient? It's fairly simple now and I want to make all my own programs without having to download others, because that's not as fun. Also learning can't hurt.
Lyqyd #2
Posted 27 August 2013 - 09:04 PM
You want to maximize the number of blocks removed per fuel used, so the easiest way to improve that ratio is to dig forward and dig three layers at a time. You can do this back and forth across the face of your tunnel if it's wide/tall enough, or you can dig the whole length of the tunnel and back in three-block-high swaths.
DashMagic #3
Posted 28 August 2013 - 10:49 AM
You want to maximize the number of blocks removed per fuel used, so the easiest way to improve that ratio is to dig forward and dig three layers at a time. You can do this back and forth across the face of your tunnel if it's wide/tall enough, or you can dig the whole length of the tunnel and back in three-block-high swaths.

Alright, but how would I work with heights more than 3? That would be extremely efficient at 3 height and I could create a loop for that, but at heights more than 3 I'm not sure how I would loop it.
TheDawgMiner #4
Posted 28 August 2013 - 12:35 PM
Are you building true tunnels or just after max ore? the best max ore program I have found fuel wise is by xxAustinKKxx, reviewing his program code MAY help solve your problem for a true tunnel maker as the path finder function does exactly what you describe in horizontal movements. As far as not -3 heights, I would dig the 3 layers heading away from start and the other 1 or 2 on a "return to chest" or use 3 functions(3, 2 &amp; 1 layer digs) with <3, <2 arguments to call each.