Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local has_block, data = turtle.inspectDown()
- local x = 0
- local y = 0
- local facing = "north"
- local done = 0
- local function updateY()
- if facing=="north" then
- y = y + 1
- elseif facing=="south" then
- y = y - 1
- end
- end
- while true do
- has_block, data = turtle.inspectDown()
- if turtle.getFuelLevel() < 50 then
- turtle.select(16)
- turtle.refuel()
- turtle.select(1)
- end
- if has_block then
- if data.state.age==7 then
- turtle.digDown()
- turtle.placeDown()
- turtle.forward()
- updateY()
- else
- turtle.forward()
- updateY()
- end
- done = 0
- elseif done < 1 then
- if facing=="north" then
- turtle.turnRight()
- turtle.forward()
- x = x + 1
- turtle.turnRight()
- turtle.forward()
- facing = "south"
- elseif facing=="south" then
- turtle.turnLeft()
- turtle.forward()
- x = x + 1
- turtle.turnLeft()
- turtle.forward()
- facing = "north"
- end
- done = done + 1
- else
- updateY()
- if facing=="south" then
- while y > 0 do
- turtle.forward()
- y = y - 1
- turtle.turnRight()
- end
- end
- if facing=="north" then
- turtle.turnLeft()
- end
- while x > 0 do
- turtle.forward()
- x = x - 1
- end
- turtle.turnLeft()
- turtle.forward()
- for i=1,15,1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.up()
- turtle.select(16)
- while turtle.getItemCount() < 64 do
- turtle.suck(1)
- end
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.select(1)
- facing = "north"
- done = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement