Jump to content

How to break mid webWalk?


Recommended Posts

Posted

After  fiddling around with the api I finally got my bot to do everything he needs to, I just wonder if there is a way to run a loop during the web walk that I could run my own anti ban or if there was a better way to just afk mid walk.

if (!getInventory().isFull() && !mineArea.contains(myPlayer()) && !getBank().isOpen() ) {
			state = "Walking to Mining spots.";
			walking.webWalk(mineArea);
		}

When the bot is navigating it follows the road in alkharid and the same line in the dessert everytime. 

Posted

There are no obstacles in the way, I just want it to afk randomly at least. I'm not really sure how to correctly implement WebWalkEvent either.

I think something like this would work:

 

Position dst = new Position(0,0,0);
INodeRouteFinder nrf = INodeRouteFinder.threadSafeWrapper(INodeRouteFinder.createAdvanced());
WebWalkEvent e = new WebWalkEvent(nrf, dst);
e.setBreakCondition(new Condition() {
     @Override
     public boolean evaluate() {
          return random(100) == 1;
     }
});

boolean success = execute(e).hasFinished();
        
if(!success) {
    // Couldn't walk to dst or we breaked
}

You can either add a sleep in the evaluate of the break condition or if success = false

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...