I was wondering why instead of using islocation() we dont use a function to find the closest waypoint on that Z-axis?
Is there a way to find the closest waypoint on that floor?
I was wondering why instead of using islocation() we dont use a function to find the closest waypoint on that Z-axis?
Is there a way to find the closest waypoint on that floor?
Your definition of closest needs to be explained a bit, it's kinda hard to say. If, by closest, you mean the one which is nearest to you, then sure, this can be calculated by examining all waypoints and checking which has the lowest combined X+Y difference between it and your current location. If, on the other hand, you want to know which one will take the least steps to walk to, you're in for an entirely different challenge. For this you'll need a pathfinding algorithm and I don't believe the bot currently provides you with this. If you are creating scripts, I'd recommend just measuring out a few "zones" and having one go to waypoint for each.