Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get dimensions of box
- print("How much in front of me do you want to clear out?")
- local z = read()
- print("How much horizontal space?")
- local x = read()
- print("How much vertical space?")
- local y = read()
- -- Functions
- local function fwd()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- local function moveUp()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- local function moveDown()
- while not turtle.down() do
- turtle.digDown()
- end
- end
- local function clearRow()
- turtle.turnRight()
- for i = 1, x - 1 do
- fwd()
- end
- turtle.turnRight()
- turtle.turnRight()
- for i = 1, x - 1 do
- fwd()
- end
- turtle.turnRight()
- end
- local function clearFace()
- clearRow()
- for i = 1, y - 1 do
- moveUp()
- clearRow()
- end
- for i = 1, y - 1 do
- moveDown()
- end
- end
- local function clearAll()
- for i = 1, z do
- fwd()
- clearFace()
- end
- -- return to start
- end
- clearAll()
- for i = 1, z do
- turtle.back()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement