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.

Problems using localWalker.walkPath(...) to walk a predefined path.

Featured Replies

Hi all, hopefully someone can help me out here.

I'm trying to write a simple cow killing script featuring a death walk from Lumbridge back to the (western) cow field.

The path I've declared looks like this:

 private final Position[] PATH_TO_COWS = {
        new Position(3225,3219,0), new Position(3234,3219,0), new Position(3230,3232,0), new Position(3218,3264,0),
        new Position(3215,3277,0), new Position(3197,3281,0), new Position(3199,3289,0)
    };

And the relevant code looks like this:

case RUNNING_TO_COWS:
       log("Beginning running case.");

       localWalker.walkPath(PATH_TO_COWS);
       log("Finished walking path.");
       current_state = State.IDLE;
       break;

My script uses a simple state-machine design, and RUNNING_TO_COWS is a state that occurs immediately after the player has died and respawned in lumbridge. It is also triggered on script startup if the player is in Lumbridge (this is the case for the log output below).

Unfortunately what happens when I run this is that the bot walks to the first point in my list at (3225,3219,0) and then stops. At this point walkPath thinks it has reached the end of the path and thus ends. The log output looks like this:

 

[iNFO][bot #1][07/03 02:50:05 AM]: Started script : Cow Killer
[iNFO][bot #1][07/03 02:50:05 AM]: Beginning idle case. // In the idle case some code verifies the player is in Lumbridge and thus starts the RUNNING_TO_COWS case.
[iNFO][bot #1][07/03 02:50:06 AM]: Beginning running case.
[iNFO][bot #1][07/03 02:50:12 AM]: Finished walking path. // This occurs when the first point in the path has been reached.
[iNFO][bot #1][07/03 02:50:13 AM]: Beginning idle case.
 
Does anyone have any idea what I am doing wrong here? Any help would be very much appreciated. Will walkPath handle obstacles such as the gate to the cow field or will I have to do that manually? I had a look at https://github.com/Lem0ns/Walker but it seems overly bulky for my simple use case.
It would also be helpful to know where I could find open source OSBot scripts to study, because I haven't been able to find many browsing the forums and I feel this is the best way to learn.

 

It's possible the distance is too far between each point. DId you use MMU or did you manually get the points? Try making more points inbetween, or use Josed's path maker.

Edited by Twin

My friend, do you have in your getState() something like this?

if(LUMB_AREA.contains(myPlayer()))
   return STATE.WALK_TO_COWS;

Because if that's the case the problem is simple. You just walk out of the LUMB_AREA and thus you don't even get to the WALK_TO_COWS state.

sounds like the distances are too far apart. A sure way to fix this is to record every tile between you and your destination. I can send you a path-recording script if u want, it would speed up the process!

 

apa

  • Author

Thanks for the quick responses guys! From what I've seen the community here seems great.

 

It's possible the distance is too far between each point. DId you use MMU or did you manually get the points? Try making more points inbetween, or use Josed's path maker.

 

I will try making them closer together and post again with my progress. Do you know where I can find Josed's path maker?

Yes, this seems to have done the trick! Thanks again.[/quote

No problem :) let me know if you have any other questions

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.