Hey!
The logic implemented (checking for the position of the point, etc) will be fine if you don't have any obstacles. If you have an obstacle, you will need to implement a pathfinding algorithm, you can use A* which will be perfect for your use case.
Here is an example in C++:

Also you might be interested in a way to check for the "line of sight" (not willing to attack behind an obstacle, even thought the server will accept the request), the algorithm is:
Regarding the other details, you should walk not one cell by one cell but follow this formula:

As an example, if you have a speed of 10 (an adventurer without any speed boost), you will have to walk a distance of 3, which means that if you are walking in a straight line from 10;10 to the bottom, you will send walk 10 13. If you go to the lower right corner, you will not send walk 13 13 (because you will travel a distance of 4.25, (3²+3²)^0.5) but most probably walk 12 12 ((2²+2²)^0.5 is the latest value before exceeding a distance of 3).
Regarding the delay between each walk, you must follow this formula:

but use the actual distance traveled, not the calculated one, in the example with walk 12 12, you walk a distance of (2²+2²)^0.5=2.83, you have a speed of 10, so you must send the next walk not earlier than 2.83*2500/10=707ms.
You also need to follow two other things:
- you should not walk when you cannot (it was possible to walk while being stunned, but I think it has been patched) - so check for cond packet (rooted) and whether or not the character is alive
- you should listen to the tp packet - even though this implementation would make your walking algorithm really accurate and trustful, you might get a lag (in that case, the tp packet should restart your walk algorithm from the new position) but also, you might just get teleported