Jump to content

Interrupt walking


Plus

Recommended Posts

Hi everyone,

I'm new to osbot, but I have coded years ago with rsbot and the likes. I'm looking to get back into coding and am having some trouble with doing actions while walking. 

I was using local walking such as:

getWalking().walk(object); 

However I was having an issue where the bot refused to do anything else until the walking sequence was complete. I did some research and found that perhaps using a WalkingInstance was what I needed so I did this:

WalkingEvent walkToObject = new WalkingEvent(object);
            walkToObject.setOperateCamera(true);
            walkToObject.setBreakCondition(new Condition() {
                 @Override
                 public boolean evaluate() {
                     return object.getPosition().isVisible(api.bot);
                 }
             });
            getBot().getEventExecutor().execute(walkToObject);

However I am having the same issue, where the bot will not do anything (ex. interact with the object once it is visible) until the walking sequence is completed. What am I doing wrong? I basically want to be able to walk to an object if it is not visible, however while walking I want to be able to interact with it at the moment once it is visible.

Any help would be appreciated!

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