Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- io.write("Enter the Turtles Current Y Level: ")
- y_current = io.read()
- io.write("Enter Desired Mining Y Level: ")
- y_toMine = io.read()
- io.write("Length of Tunnel: ")
- length = io.read()
- io.write("Width of Tunnel: ")
- width = io.read()
- io.write("Hight or Tunnel: ")
- hight = io.read()
- to_turn = ("")
- io.write("Enter Space Between Tunnels: ")
- tunnel_spacing = io.read()
- io.write("Number of Tunnels: ")
- tunnels = io.read()
- io.write("What direction if the turtle facing?: ")
- facing = io.read()
- function digDown()
- turtle.digDown()
- turtle.down()
- end
- function toYLevel()
- local y_level = tonumber(y_current) - tonumber(y_toMine)
- print("Digging down ", y_level, " blocks")
- for i = 1, y_level, 1 do
- digDown()
- end
- end
- function checkBlock()
- local success, data = turtle.inspect()
- if success then
- print("Block name: ", data.name)
- end
- end
- function digTunnel()
- for i = 1, length, 1 do
- turtle.dig()
- turtle.forward()
- end
- for i = 1, hight - 1, 1 do
- turtle.digUp()
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- for x = 1, length - 1, 1 do
- turtle.dig()
- turtle.forward()
- end
- end
- for i = 1, width - 1, 1 do
- for x = 1, hight - 1, 1 do
- turtle.down()
- end
- if to_turn == "Left" then
- to_turn = "Right"
- elseif to_turn == "Right" then
- to_turn = "Left"
- elseif hight % 2 == 0 then
- to_turn = "Left"
- elseif hight % 2 ~= 0 then
- to_turn = "Right"
- end
- if to_turn == "Left" then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- elseif to_turn == "Right" then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- for i = 1, length, 1 do
- turtle.dig()
- turtle.forward()
- end
- for i = 1, hight - 1, 1 do
- turtle.digUp()
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- for x = 1, length, 1 do
- turtle.dig()
- turtle.forward()
- end
- end
- end
- end
- function newTunnel()
- if facing == "Left" then
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- elseif facing == "Right" then
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.down()
- end
- end
- --[[function newTunnel()
- for i = 1, hight, 1 do
- turtle.down()
- end
- if width % 2 == 0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- for i = 1, tunnel_spacing + 1, 1 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- end
- if width % 2 == 0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end --]]
- --[Need to fix turtle digging back into tunnel spacing]--
- toYLevel()
- for i = 1, tunnels, 1 do
- digTunnel()
- newTunnel()
- end
Advertisement
Add Comment
Please, Sign In to add comment