Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkUp()
- local needFuel = 0
- local needTorch = 0
- local needEmpty = 0
- if turtle.getFuelLevel() < 10 then
- needFuel = 1
- end
- if turtle.getItemCount(4) == 0 then
- needTorch = 1
- end
- if turtle.getItemCount(16) > 0 then
- needEmpty = 1
- end
- if needFuel == 1 or needTorch == 1 or needEmpty == 1 then
- turtle.turnRight()
- turtle.turnRight()
- else
- return
- end
- if needFuel == 1 then
- turtle.select(1)
- turtle.place()
- turtle.suck()
- turtle.refuel()
- turtle.dig()
- end
- if needTorch == 1 then
- turtle.select(2)
- turtle.place()
- turtle.select(4)
- turtle.suck()
- turtle.select(2)
- turtle.dig()
- end
- turtle.select(3)
- turtle.place()
- for i = 5, 16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(3)
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- return
- end
- local dist = 30
- for i = 0, dist do
- while turtle.detect() do
- turtle.dig()
- checkUp()
- end
- turtle.forward()
- while turtle.detectUp() or turtle.detectDown() do
- turtle.digUp()
- checkUp()
- turtle.digDown()
- checkUp()
- end
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement