Jump to content

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


Evesy

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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