Heeeerrreee's Gangsiry! I've made a robot program to automatically harvest sugarcane.
The program can be found at my github, or wget fetched.
https://github.com/NoahNMorton/Gangsir_MC_LuaPrograms/blob/master/OpenComputers/SugarcaneHarvester.lua
wget https://raw.githubusercontent.com/NoahNMorton/Gangsir_MC_LuaPrograms/master/OpenComputers/SugarcaneHarvester.lua harvester.lua
To set it up, place 2 columns of sugarcane right next to each other, and set the robot down on top of a chest or similar container on the right column. The robot uses the blocks under it to determine how far to go,