Jump to content

How to break mid webWalk?


Cmontryme

Recommended Posts

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. 

Link to comment
Share on other sites

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

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