Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fuel()
- if turtle.getFuelLevel() <= 50 then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- function isValuable()
- local isJunk = false
- for i=1,4 do
- turtle.select(i)
- if turtle.detect() or turtle.compare() then
- isJunk = true
- end
- end
- if isJunk then
- return false
- else
- return true
- end
- end
- function checkWalls()
- for j=1,4 do
- if isValuable() then
- turtle.dig()
- end
- turtle.turnRight()
- end
- end
- -- ( Program Start ) --
- local depth = 0
- fuel()
- turtle.digDown()
- while turtle.detectDown() == false do
- fuel()
- turtle.down()
- depth = depth + 1
- checkWalls()
- turtle.digDown()
- end
- for k = 1,depth do
- fuel()
- turtle.up()
- end
Advertisement
Add Comment
Please, Sign In to add comment