http://wiki.openttd.org/AI:RoadPathfinder describes how to use Pathfinder.Road but it does not work as expected since version 4 uses the GameScript API and not the AI API. Minor changes are required (replace GS* to AI* in main.nut and library.nut).
Please find the new version attached - it worked for me.
Pathfinder.Road-5.tar - new version using the AI API (38 KB)
Source
original issue reported by yozi about 6 years ago.