Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function explore()
- for count = 1, 4 do
- if turtle.detect() and interesting_block_ahead() then
- while turtle.detect() do
- if not turtle.dig() then
- return
- end
- sleep(0.8)
- end
- if turtle.forward() then
- explore()
- turtle.back()
- end
- end
- turtle.turnRight()
- end
- end
- function mine(max_depth)
- depth = 0
- for count2 = 1, math.floor(max_depth) do
- if turtle.detectDown() and not turtle.digDown() then
- break
- end
- depth = depth + 1
- turtle.down()
- explore()
- end
- for count3 = 1, math.floor(depth) do
- turtle.up()
- end
- end
- function interesting_block_ahead()
- for _, k in ipairs(boring_slots) do
- turtle.select(k)
- if turtle.compare() then
- return false
- end
- end
- return true
- end
- boring_slots = ({12, 13, 14, 15, 16})
- mine(10)
Advertisement
Add Comment
Please, Sign In to add comment