Jump to content

Cannot bot walk far distances?


Bobrocket

Recommended Posts

So, for part of my quest bot it has to fill a bucket of milk.

Code:

/* Go to dairy cows if we have a bucket */
                if (hasItem("Bucket")) {
                    walkTo(placesToGo[2]);
                    sleep(750);
                    /* Open the gate if needed */
                    Entity gate = closestEntity("Gate");
                    openDoor(gate);
                    /* Milk the cow */
                    Entity cow = closestEntity("Dairy cow");
                    if (cow != null && cow.isVisible()) {
                        moveCamera(cow);
                        sleep(750);
                        cow.interact("Milk");
                        new ConditionalSleep(750000) {
                            @Override
                            public boolean condition() {
                                return parent.getInventory().contains(itemsNeeded[1]);
                            }
                        }.sleep();
                    }
                    sleep(750);
                }

For some reason, the bot will not walk from lumbridge castle to dairy cows. Is there any reason for this?

Edited by Bobrocket
Link to comment
Share on other sites

It seems a bit silly to ask us about a walkTo method that you seemingly wrote yourself, and haven't provided the source for in this post.

 

If however it uses some of the standard localWalker or WalkingEvent API, then the pathfinding is limited to the currently loaded region.

Also, offtopic, but sequential execution like that is quite bad. Try to set it up to not rely on the previous action to have completed successfully. Easily done by ensuring that only 1 thing is done in every loop cycle.

Link to comment
Share on other sites

It seems a bit silly to ask us about a walkTo method that you seemingly wrote yourself, and haven't provided the source for in this post.

 

If however it uses some of the standard localWalker or WalkingEvent API, then the pathfinding is limited to the currently loaded region.

Also, offtopic, but sequential execution like that is quite bad. Try to set it up to not rely on the previous action to have completed successfully. Easily done by ensuring that only 1 thing is done in every loop cycle.

Sorry, I forgot to say here but the walkTo method is just localWalker.walkTo(position) and then a conditional sleep until the player is no longer moving.

I am going to make sure that I am not using sequential execution later, as right now this is just a test to ensure that everything actually works.

 

So how am I going to get my bot to walk there? Is there any way I could generate a path there?

Link to comment
Share on other sites

If you do have a path, you could just keep walking to the loaded position closest to your target destination. As you reach that position the next regions should load.

 

Also, localWalker walk methods aren't asynchronous, so there shouldn't be a need for a conditional sleep after invoking it.

Link to comment
Share on other sites

If you do have a path, you could just keep walking to the loaded position closest to your target destination. As you reach that position the next regions should load.

 

Also, localWalker walk methods aren't asynchronous, so there shouldn't be a need for a conditional sleep after invoking it.

I see, thank you. I know that localWalker is synchronous but I have that there because sometimes my client would lag a bit and would try to do the next bit without finishing walking so I added that check.

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