Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("This program digs tunnel 3x3") --and even put every 5 blocks torch on wall
- print("Important ! place torches in slot 1 and solid block to slot 2 !")
- print("How long tunnel do you want ? ")
- local x = read()
- local times = 0
- print("Digging "..x.." blocks long tunnel")
- turtle.turnLeft()
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.turnRight()
- for i = 1, x do
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.turnRight()
- for j = 1, 2 do
- for i = 1, 2 do
- while not turtle.forward() do
- turtle.dig()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- for k = 1, 2 do
- while not turtle.forward() do
- turtle.dig()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.down()
- if math.fmod(times,5) == 0 then
- for u = 1, 2 do
- while not turtle.forward() do
- turtle.dig()
- end
- end
- if not turtle.detect() then
- turtle.select(2)
- turtle.place()
- end
- turtle.select(1)
- turtle.back()
- turtle.place()
- turtle.down()
- turtle.forward()
- else
- turtle.down()
- for l = 1, 2 do
- while not turtle.forward() do
- turtle.dig()
- end
- end
- end
- turtle.turnRight()
- times = times + 1
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- print("And done")
- local fuelstate = turtle.getFuelLevel()
- print("I have "..fuelstate.." fuel")
- if fuelstate < 1000 then
- print("Please refuel me")
- end
Advertisement
Add Comment
Please, Sign In to add comment