Jump to content

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


Recommended Posts

Posted

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.

 

Posted

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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...