Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkFuel()
- end --checkFuel()
- function turnAround()
- turtle.turnRight()
- turtle.turnRight()
- end --turnARound()
- function digNext(torchCounter)
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- if torchCounter == 2 then
- turnAround()
- turtle.select(15)
- turtle.place()
- turnAround()
- print("Placing mainshaft torch")
- end --if
- turtle.turnLeft()
- print("turn Right")
- print("next Tunnel")
- end --digNext
- function tunnel(givenLength)
- local distance = 0
- for index = 1, givenLength do
- turtle.dig()
- if turtle.forward() then
- distance = distance + 1
- end --if
- turtle.digUp()
- turtle.select(1)
- turtle.placeDown()
- if distance == 10 then
- turtle.select(16)
- print("Placing tunnel torch..")
- turnAround()
- turtle.place()
- turnAround()
- distance = 0
- checkFuel()
- end --if
- end --for
- turtle.up()
- for index = 1, givenLength do
- turtle.back()
- end --for
- turtle.down()
- end --tunnel()
- print("Input tunnel length:")
- local length = tonumber(read())
- print("Tunnel quantity")
- local quantity = tonumber(read())
- local torchNext = 0
- print("starting excavation...")
- checkFuel()
- for index = 1, quantity do
- if torchNext == 3 then
- torchNext = 0
- end --if
- tunnel(length)
- checkFuel()
- digNext(torchNext)
- torchNext = torchNext + 1
- end --for
- print("The tunnels has been excavated!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement