Automation code for hydraulic tool