Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- width = args[1];
- length = args[2];
- height = args[3];
- turtle.turnRight();
- for i=0, width/2-1, 1 do
- --Assuming that we were put in the centre of one side of the bottom of the cube
- -- move to the side of the cube to start.
- turtle.dig();
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.turnLeft();
- end
- function mineRow(num)
- for i=0, num, 1 do
- --Dig infront of you.
- while turtle.detect() do
- turtle.dig()
- end
- --dig infront of you if you can't move forward.
- while not turtle.forward() do
- turtle.dig()
- end
- end
- end
- function digPlane(x, y)
- for i=0, y, 2 do
- --Mine 1 row
- mineRow(x);
- turtle.turnLeft();
- --Else turn around and get ready for the next one.
- mineRow(0);
- turtle.turnLeft();
- --Mine 1 row
- mineRow(x);
- turtle.turnRight();
- --Exit if we've finished this area.
- if i+2 >= y then
- break
- end
- --Mine column a little
- mineRow(0);
- turtle.turnRight();
- end
- --Turn around and get ready for the next plane.
- turtle.turnLeft();
- end
- function digCube(x, y, z)
- for i=0, z, 1 do
- digPlane(x, y);
- --Dig above you
- while turtle.detectUp() do
- turtle.digUp()
- end
- --Move up
- while not turtle.up() do
- turtle.digUp()
- end
- end
- end
- digCube(length, width, height);
Advertisement
Add Comment
Please, Sign In to add comment