Jump to content

Script isn't walking when it's close to the position


Recommended Posts

Posted (edited)

Hey guys,

When my bot is close to the coordinates it has to go to and it gets the new command:
 

getWalking().walk(AREA);

It just ignores it and thinks it's there already, I have to same problem when I'm using webWalk instead of the normal walk function.

Does anyone perhaps know when I'm doing wrong here?

Edited by Evesy
typo's
Posted

I'm not exactly sure what it was but IIRC it checks if you are within X tiles to the destination, so when you get close to the target it returns true.
Meaning if you wanted to get to a specific tile you would need to add a custom method, see below.

private static boolean walk(Script script, Position position) {
        WalkingEvent event = new WalkingEvent(position);
        event.setMinDistanceThreshold(0);
        return script.execute(event).hasFinished();
    }

I could be wrong maybe better to check with someone who isn't as rusty as me when it comes to the methods.

  • Like 1
Posted
1 hour ago, fhhhphgj said:

I'm not exactly sure what it was but IIRC it checks if you are within X tiles to the destination, so when you get close to the target it returns true.
Meaning if you wanted to get to a specific tile you would need to add a custom method, see below.


private static boolean walk(Script script, Position position) {
        WalkingEvent event = new WalkingEvent(position);
        event.setMinDistanceThreshold(0);
        return script.execute(event).hasFinished();
    }

I could be wrong maybe better to check with someone who isn't as rusty as me when it comes to the methods.

 

8 minutes ago, Juggles said:

If you're within 2-3 tiles it thinks you're in the area. Use the code above to override it

 

Thanks a lot guys! Noob question coming in: how do I implement this?..

  • Sad 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...