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

Cube Digger + Quarry Frame Destroyer

Started by Evan, 19 March 2012 - 09:20 AM
Evan #1
Posted 19 March 2012 - 10:20 AM
http://pastebin.com/xipmT4p0 Cube Digger
http://pastebin.com/ymnvcNbL Quarry Frame Destroyer



Cube Digger

This is my first full script in lua and for computercraft, and probably the messiest piece of code I've ever wrote…

I'd like to send a big shoutout to BlackRa1n who helped make this program a lot more use-friendly, and posted it on! Thanks man :D/>/>

This program is designed to simply make a mining turtle dig out a cube which size is defined by the user.


It should be pretty self-explanatory, but if not read following:

Tutorial:
SpoilerWhen you run the program on a mining turtle (Im assuming you already know how to do that) it will print "Amount of blocks forward"
Enter the amount of blocks you want the mining turtle to move forward. Only enter whole numbers or 0 (including negatives), or else the turtle will act strangely.
If you were to enter 3, then the turtle will move like this
Spoiler

If you input 0, it won't move forward at all, and will only move left/right and up/down.


The turtle will the print "Amount of blocks right"
Again, only input whole number values or 0 (including negatives). If you input 2 right, the turtle will move like this:
Spoiler

If you entered a negative, then it would move the opposite direction. For example if you told it to move "-3" forward it would move back 3. (Black arrow)
If you told it to move "-2" right it would move left 2.(Red arrow)

NB: The turtle will not move straight forward then straight right, it will do a circle of sorts, so as to clear out the entire cube that you designate.
Spoiler

The turtle will then output "Amount of blocks up".
Again, typing in 3 will make the turtle dig 3 up like the following:
Spoiler

and typing "-3" will make it move 3 down.


This means that if you type in 3 forward, 2 right and 3 up, then the turtle will dig out a cube that is 3 high, 2 wide and 3 long.

This does have limitted uses, but the one i programmed it for is to flatten out a bit of land (IndustrialCraft terraformer just wasn't fast enough), but I guess you could do it to do some strip mining if you had 2 or 3 of them, or to mine out a basement…




Quarry Frame Destroyer
This is for use with buildcraft, and is used to destroy the framework that is left behind by the quarry when it has finished.

Simple place the turtle at one of the bottom corners of the quarry framework, and load the program. The forward length of the quarry is how long the quarry is, in the direction the turtle is facing. The length of the quarry is not, however, the length of the hole it digs, but the length of the framework itself, so it is 2 blocks longer than the hole it digs.

You will then be asked to input the Side Length of the quarry, which is simply how long the quarry is to the side of the mining turtle (which side the turtle is at doesn't matter!).

Then enter the height of the quarrys framework, and press enter.

The turtle will then begin to dig out the quarry's framework!

Pretty simple really :)/>/>





Any questions feel free to post.

NB.If you get in the way of the mining turtle often the turtle will mess up its sequence, and you will have to reprogram it.

Feel free to copy edit, distribute any of my code, I don't really care what you do with it tbh…

Evan.
Zer0t3ch #2
Posted 24 March 2012 - 03:53 AM
Looks cool! Might make my own little modifications and repost, with your permission, of course! :3 Anyway, looks cool!
BlackRa1n #3
Posted 24 March 2012 - 11:04 AM
Feel free to copy edit, distribute any of my code, I don't really care what you do with it tbh…

Looks cool! Might make my own little modifications and repost, with your permission, of course! :3 Anyway, looks cool!

Go for it! :(/>/>
What you gonna do with it?
Evan #4
Posted 27 March 2012 - 09:59 AM
Can do whatever you want with it, just to warn you though its insanely messy and over-complicated… Ahwell :o/>/>
Evan #5
Posted 13 April 2012 - 10:09 AM
Just added a Quarry Frame Destroyer, for digging out the framework that's left behind from using buildcrafts quarry :P/>/>
flashy99 #6
Posted 28 September 2012 - 03:20 PM
When I try to run the cube digger, I get an error for line 1, unexpected symbol. I've looked at my saved copy and compared it to yours and I see no difference. For reference, this is line 1:

function digIt()