Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Walking

Joined
Jul 24, 2014
Messages
188
I'm stuck on this for already a week or 2 now, I've tried RegionPath, WebPath, BresenhamPath, PredefinedPath, everything.

What happens is the following: the path is correctly generated, but the bot only clicks once on the minimap and when my player has reached that position, it doesn't move to the next position, it just sits there somewhere halfway the path.

I use this code:
Code:
Coordinate coord = new Coordinate(3189, 3241, 0); //A point somewhere in Lumbridge that I used for testing purposes
final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(coord);
path.step();

The same happens when I replace the WebPath line by RegionPath.buildTo(coord);, or by BresenhamPath, or when I use a PredefinedPath.

Do I need to add a loop somewhere?
 
I've been called a god before.
Joined
Aug 5, 2014
Messages
3,212
maybe make an area (if there is one) and then while(!area.contains(Players.getLocal().getPosition()))

cheers
 
Joined
Jul 24, 2014
Messages
188
Path.step takes a single step. So I guess you need another method.
Well that explains alot :p

I tried putting it in a loop and this seems to have worked :) Might want to include that in those walking tutorials
 
Joined
Mar 11, 2014
Messages
450
Well that explains alot :p

I tried putting it in a loop and this seems to have worked :) Might want to include that in those walking tutorials
I'm not sure.. i just looked at the docs. I've not yet experimented with the api just yet.
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
If you're using a looping script it shouldnt need an extra loop.

If you're using the Execution framework or whatever it's called, you've probably set the conditions in a way that it only calls it once and because it never reached the end just sits there. You'll want to fix that because it's best to not use extra loops if they're not needed.
 
Last edited:
I've been called a god before.
Joined
Aug 5, 2014
Messages
3,212
If youre using a looping script it shouldnt need an extra loop.
But, it would need to check every Activate or whatever its called (boolean) to run this method again. So waste of RAM imo
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
But, it would need to check every Activate or whatever its called (boolean) to run this method again. So waste of RAM imo
It's better practice to have each loop only perform one action rather than contain a nested loop performing actions over and over until the end condition, so it's best to sterr clear of extra loops where they're not absolutely necessary. It's also the best way to make the script stop as soon as the stop button is clicked as we don't force scripts to stop.
 
Joined
Jul 24, 2014
Messages
188
If you're using a looping script it shouldnt need an extra loop.

If you're using the Execution framework or whatever it's called, you've probably set the conditions in a way that it only calls it once and because it never reached the end just sits there. You'll want to fix that because it's best to not use extra loops if they're not needed.
I'm using Executor + my own framework :p but it's pretty complicated, anyways it's fixed :)
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
It's better practice to have each loop only perform one action rather than contain a nested loop performing actions over and over until the end condition, so it's best to sterr clear of extra loops where they're not absolutely necessary. It's also the best way to make the script stop as soon as the stop button is clicked as we don't force scripts to stop.
This is spot on.
 
Top