I have a felling turtle for redwood trees.
It plants a 2x2, applies bonemeal, digs in, then up untill digUp returns false, move 1 block sideways and dig down again.
I dig down untill compareDown to inventory slot 1 is true, slot 1 holds a block of dirt.
You could fancy it up and count how many...