Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global direction =
- function forwd (times)
- for i=1, times do
- if turtle.forward() then
- --just go
- else
- turtle.dig()
- turtle.forward()
- end
- end
- end
- function turnAround()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function circle ()
- turtle.digDown()
- turtle.down()
- forwd(4)
- turtle.turnLeft()
- direction = 'E'
- forwd(1)
- turtle.turnLeft(1)
- direction = 'N'
- forwd(4)
- turtle.turnLeft()
- direction = 'W'
- forwd(1)
- turtle.turnLeft()
- direction = 'S'
- end
- function ascend ()
- local surfaced = false
- local hitBottom = false
- local moving = true
- turtle.up()
- if direction == 'S' then
- turnAround()
- while moving == true do
- moving = turtle.forward()
- else if direction == 'E' then
- else if direction == 'N' then
- else if direction == '
- while surfaced ~= true do
- local isBlock, type = turtle.inspect()
- print (type.name)
- if type.name == 'minecraft:chest' or isBlock == false then
- surfaced = true
- print (type.name, isBlock, "breaking?")
- break
- else
- turtle.up()
- end
- end
- for i=1, 16 do
- turtle.drop()
- end
- turtle.select(1)
- turnAround()
- while hitBottom == false do
- hitBottom = turtle.down()
- end
- end
- function checkInv ()
- if turtle.getItemCount(16) > 0 then
- ascend()
- end
- end
- --Main Program
- for i=1, 75 do
- checkInv()
- circle()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement