Normangorman Posted July 3, 2015 Share Posted July 3, 2015 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. Quote Link to comment Share on other sites More sharing options...
Twin Posted July 3, 2015 Share Posted July 3, 2015 (edited) 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 July 3, 2015 by Twin 1 Quote Link to comment Share on other sites More sharing options...
blabla123 Posted July 3, 2015 Share Posted July 3, 2015 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. Quote Link to comment Share on other sites More sharing options...
Apaec Posted July 3, 2015 Share Posted July 3, 2015 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 Quote Link to comment Share on other sites More sharing options...
Normangorman Posted July 3, 2015 Author Share Posted July 3, 2015 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? Quote Link to comment Share on other sites More sharing options...
Normangorman Posted July 3, 2015 Author Share Posted July 3, 2015 Yes, this seems to have done the trick! Thanks again. 1 Quote Link to comment Share on other sites More sharing options...
Twin Posted July 3, 2015 Share Posted July 3, 2015 Yes, this seems to have done the trick! Thanks again.[/quote No problem let me know if you have any other questions Quote Link to comment Share on other sites More sharing options...