Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- print("Place Coal in Slot 1")
- print("Place at least 1 Cobblestone in Slot 2")
- print("Place Torches in Slot 3")
- print("Make tunnel length an even number.")
- print("")
- print("Enter tunnel length: ")
- tunnellength = read()
- term.clear()
- term.setCursorPos(1,1)
- print("Tunneling " .. tunnellength .. " blocks, then returning.")
- sleep(2)
- local torchpos = 0
- function fuelcheck()
- if turtle.getFuelLevel() < 150 then
- turtle.select(1)
- turtle.refuel(2)
- end
- end
- function dropcobble()
- for i=4,16 do
- turtle.select(i)
- if turtle.compareTo(2) then
- turtle.drop()
- end
- end
- end
- function minewallRight()
- turtle.dig()
- moveforward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- moveforward()
- turtle.digDown()
- turtle.digUp()
- moveforward()
- turtle.digDown()
- turtle.digUp()
- turtle.turnLeft()
- torchpos = torchpos + 1
- end
- function minewallLeft()
- turtle.dig()
- moveforward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- moveforward()
- turtle.digDown()
- turtle.digUp()
- moveforward()
- turtle.digDown()
- turtle.digUp()
- turtle.turnRight()
- torchpos = torchpos + 1
- end
- function minecycle()
- for z = 1, tunnellength/2 do
- minewallRight()
- minewallLeft()
- placetorch()
- end
- end
- function placetorch()
- if torchpos % 4 == 0 then
- turtle.select(3)
- turtle.turnLeft()
- turtle.dig()
- turtle.place()
- turtle.turnRight()
- dropcobble()
- fuelcheck()
- end
- end
- function moveforward()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function turtlehome()
- for y = 1, tunnellength do
- turtle.forward()
- end
- end
- fuelcheck()
- turtle.digUp()
- turtle.up()
- minecycle()
- turtle.turnLeft()
- turtle.turnLeft()
- turtlehome()
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- print("Mining Successful")
Advertisement
Add Comment
Please, Sign In to add comment