Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- steps = 0
- function goBack()
- turtle.turnRight()
- turtle.turnRight()
- for i = 1,steps do
- turtle.forward()
- end
- for i = 1,15 do
- turtle.select(i)
- if turtle.compareTo(16) then
- turtle.dropDown()
- else
- turtle.dropUp()
- end
- end
- for i = 1,turtle.getItemCount(16)-1 do
- turtle.dropDown()
- end
- turtle.turnRight()
- turtle.turnRight()
- for i = 1,steps do
- turtle.forward()
- end
- end
- function inventoryCheck()
- space = 15
- for i = 1,15 do
- if turtle.getItemSpace(i) < 64 then
- space = space - 1
- end
- end
- if space == 0 then
- return true
- end
- return false
- end
- function miningSides()
- if turtle.detect() then
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- else
- turtle.forward()
- end
- if not turtle.detect() then
- turtle.select(16)
- turtle.place()
- end
- if turtle.detectUp() then
- while turtle.detectUp() do
- turtle.digUp()
- end
- turtle.up()
- else
- turtle.up()
- end
- if not turtle.detectUp() then
- turtle.select(16)
- turtle.placeUp()
- end
- if not turtle.detect() then
- turtle.select(16)
- turtle.place()
- end
- turtle.down()
- if turtle.detectDown() then
- turtle.digDown()
- turtle.down()
- else
- turtle.down()
- end
- if not turtle.detectDown() then
- turtle.select(16)
- turtle.placeDown()
- end
- if not turtle.detect() then
- turtle.select(16)
- turtle.place()
- end
- end
- function mineAndSelect()
- --Para frente
- if turtle.detect() then
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- else
- turtle.forward()
- end
- --Para cima
- if turtle.detectUp() then
- while turtle.detectUp() do
- turtle.digUp()
- end
- turtle.up()
- else
- turtle.up()
- end
- if not turtle.detectUp() then
- turtle.select(16)
- turtle.placeUp()
- end
- turtle.down()
- --Para baixo
- if turtle.detectDown() then
- turtle.digDown()
- turtle.down()
- else
- turtle.down()
- end
- if not turtle.detectDown() then
- turtle.select(16)
- turtle.placeDown()
- end
- turtle.up()
- turtle.turnLeft()
- miningSides()
- turtle.up()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- miningSides()
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- steps = steps + 1
- if inventoryCheck() then
- goBack()
- end
- end
- while true do
- mineAndSelect()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement