Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- print("Place torches in slot 1!")
- print("Place blocks in slot 2!")
- print("Don't use wood in slot 2!")
- print("Every number counts as 8!")
- print("Example ____ 8 =a 64 tunnel in length!")
- sleep(2)
- local tArgs = { ... }
- if #tArgs ~= 1 then
- print("Usage: BranchMining <length>")
- end
- local times = 0
- l = tArgs[1]
- for k=1, l do
- for i=1,8 do
- term.clear()
- term.setCursorPos(1, 1)
- Fuel = turtle.getFuelLevel()
- print("Fuel Left: "..Fuel)
- if turtle.getFuelLevel() < 100 then
- for i=1,16 do
- turtle.select(i)
- turtle.refuel()
- end
- end
- turtle.detectUp()
- if turtle.detectUp() == true then
- repeat
- turtle.digUp()
- sleep(0.55)
- until turtle.detectUp() == false
- end
- print("")
- print("Length Completed: "..i)
- print("")
- print("Blocks Dug: "..i*2)
- print("")
- print("Torches Are Not Fixed In This Version!")
- print("")
- turtle.detectDown()
- if turtle.detectDown() == false then
- repeat
- turtle.dig()
- sleep(0.55)
- until turtle.detect() == false
- end
- turtle.detectDown()
- if turtle.detectDown() == false then
- repeat
- turtle.select(2)
- turtle.placeDown()
- sleep(.55)
- until turtle.detectDown() == true
- end
- turtle.turnLeft()
- if turtle.detect() == false then
- for i=2,16 do
- turtle.select(i)
- turtle.place()
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- if turtle.detect() == false then
- for i=2,16 do
- turtle.select(i)
- turtle.place()
- end
- end
- turtle.turnLeft()
- turtle.up()
- if turtle.detectUp() == false then
- for i=2,16 do
- turtle.select(i)
- turtle.placeUp()
- end
- end
- turtle.turnLeft()
- if turtle.detect() == false then
- for i=2,16 do
- turtle.select(i)
- turtle.place()
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- if turtle.detect() == false then
- for i=2,16 do
- turtle.select(i)
- turtle.place()
- end
- end
- turtle.turnLeft()
- turtle.down()
- if i == 8 then
- turtle.select(1)
- turtle.placeUp()
- end
- if i == 8 then
- term.clear()
- term.setCursorPos(1, 1)
- print("I have finished a 8 long tunnel segment!")
- end
- turtle.detect()
- if turtle.detect() == true then
- turtle.dig()
- else
- if turtle.detect() == false then
- turtle.forward()
- end
- end
- end
- end
- turtle.digUp()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1, l do
- turtle.forward()
- end
- for i=1,16 do
- turtle.select(i)
- turtle.drop()
- end
Advertisement
Add Comment
Please, Sign In to add comment