Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Tunnel has started.")
- io.write("Please enter the width, in number of blocks, to dig: ")
- width = io.read()
- io.write("Please enter the height, in number of blocks, to dig: ")
- height = io.read()
- io.write("Please enter the depth, in number of blocks, to dig: ")
- depth = io.read()
- print("Tunnel will run with parameters width = " .. width .. ", height = " .. height .. ", and depth = " .. depth .. ".")
- intWidth = tonumber(width)
- for i = 1, tonumber(depth) do
- currentDug = 0
- for i = 1, tonumber(height) do
- while (currentDug < intWidth) do
- turtle.dig()
- currentDug = currentDug + 1
- turtle.forward()
- if (currentDug == intWidth and i ~= tonumber(height)) then
- turtle.digUp()
- currentDug = 1
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- break
- end
- end
- end
- for i = tonumber(height) - 1, 1, -1 do
- turtle.down()
- end
- if (i ~= tonumber(depth)) then
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- tuirtle.forward()
- turtle.turnLeft()
- end
- end
- turtle.turnRight()
- for i = 1, tonumber(depth) do
- turtle.forward()
- end
- turtle.turnRight()
- for i = 1, tonumber(width) do
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement