I thought for about it for a few minutes, but I'd guess they've hard coded the actual coordinates of areas like banks as well as a bunch of coordinate pairs which are within distance of each other.
Like if Varrock Bank is at coords (a,b,c) and you are at (d,e,f), the bot looks to some data file and finds that your (d,e,f) coords are within a screen of (d+7,e-5,f+1) which itself is within a screen of (d+15,e-8,f+4). etc, etc
Maybe looking something like this in a data file:
[(d+7,e-5,f+1),(d+15,e-8,f+4)] : distance
Where 'distance' would be the actual distance between the two points.
Take your pick for solving this problem from (d,e,f) to (a,b,c):
https://en.wikipedia.org/wiki/Shortest_path_problem