Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function goUp(c)
- for up=1,c do
- if turtle.detect() then
- turtle.digUp()
- end
- turtle.up()
- end
- end
- function compareTo()
- if turtle.detect() then
- for i=1,3 do
- turtle.select(i)
- if turtle.compare() then
- return false
- end
- end
- return true
- end
- end
- function compareDown()
- if turtle.detectDown() then
- for j=1,3 do
- turtle.select(j)
- if turtle.compareDown() then
- return false
- end
- end
- return true
- end
- end
- function lookAround()
- for turn=1,4 do
- local oreFound = compareTo()
- if oreFound then
- turtle.dig()
- end
- turtle.turnLeft()
- turtle.select(1)
- end
- end
- function digWell()
- for dig=1,8 do
- lookAround()
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- end
- local oreDown = compareDown()
- if oreDown then
- turtle.digDown()
- end
- goUp(8)
- end
- digWell()
- --lookAround()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement