TARGET_FREQUENCY = 2 turtle.select(1) a = 11 b = 0 while b < a do turtle.forward() b = b+1 if b == a and turtle.getItemCount(1) < 1 then turtle.select(2) turtle.placeUp() turtle.select(1) turtle.suckUp() turtle.digUp() turtle.placeDown() b = 0 end if b == a and turtle.getItemCount(1) > 0 then turtle.placeDown() b = 0 end p = peripheral.wrap("bottom") p.setFrequency(TARGET_FREQUENCY) end