Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cannot bot walk far distances?

Featured Replies

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

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.

  • Author

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?

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.

  • Author

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.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.