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:
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
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:
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.
The turtle will then output "Amount of blocks up".
Again, typing in 3 will make the turtle dig 3 up like the following:
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.
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:
Spoiler
When 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.