Jump to content

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


Normangorman

Recommended Posts

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.

 

Link to comment
Share on other sites

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?

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