Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --distance for loading
- distance = ...
- if distance then
- distance = tonumber(distance)
- else
- distance = 35
- end
- --Counter for found lava springs
- lavaCnt = {0}
- local move = require("move1")
- local inspect = require("inspect1")
- local collectLava = require("collectLava1")
- lavaArray = {"minecraft:lava"}
- -- mines one tunnel and comes back out
- function mineTunnel (remainingLength)
- if not (remainingLength == 0) then
- move.Forward()
- if inspect.Down(lavaArray) then
- collectLava.Bottom(lavaCnt)
- end
- mineTunnel(remainingLength - 1)
- move.Forward()
- else
- move.turnBack()
- end
- end
- function collectLavaBelow(length)
- local cnt = 0
- while cnt < length do
- if turtle.forward() then
- cnt = cnt + 1
- if inspect.Down(lavaArray) then
- collectLava.Bottom(lavaCnt)
- else
- break
- end
- else
- break
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- while cnt > 0 do
- while not turtle.forward() do sleep(0.5) end
- cnt = cnt - 1
- end
- end
- turtle.dig()
- local success, err = turtle.dig()
- if err == "No tool to dig with" then
- collectLavaBelow(distance)
- else
- mineTunnel(distance)
- end
Advertisement
Add Comment
Please, Sign In to add comment