Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y=0
- function fleeUp()
- for i=1,y do
- turtle.digUp()
- turtle.up()
- end
- end
- function moveDown()
- if turtle.detectDown() then
- turtle.digDown()
- end
- if turtle.down() then
- y=y+1
- end
- end
- function floorOne()
- local retval = false
- local slot = 0
- slot = turtle.getSelectedSlot()
- if turtle.getItemCount(slot) == 0 then
- if slot < 16 then
- turtle.select(slot+1)
- turtle.placeDown()
- retval = true
- else
- retval = false
- end
- else
- turtle.placeDown()
- retval = true
- end
- return retval
- end
- function moveForward()
- if turtle.detect() then
- turtle.dig()
- end
- return turtle.forward()
- end
- turtle.select(1)
- while y < 63 do
- for i=1,4 do
- moveDown()
- end
- turnRight = true
- for i=1,9 do
- for j=1,8 do
- if not floorOne() then fleeUp(); shell.exit() end
- moveForward()
- end
- if not floorOne() then fleeUp(); shell.exit() end
- if i==9 then
- turtle.turnRight()
- turtle.turnRight()
- else
- if turnRight then
- turtle.turnRight()
- moveForward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- moveForward()
- turtle.turnLeft()
- end
- end
- turnRight = not turnRight
- end
- end
- turtle.select(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement