Ace Posted September 19, 2015 Share Posted September 19, 2015 Hey, So I'm writing a script and I tried using the osbot's local walker to walk a path but it always keeps spam clicking the first tile and doesn't walk any further. Is somebody else having this problem or is the local walker working fine for you? thanks in advance Quote Link to comment Share on other sites More sharing options...
Chris Posted September 19, 2015 Share Posted September 19, 2015 Just use a custom walker for now Quote Link to comment Share on other sites More sharing options...
Ace Posted September 19, 2015 Author Share Posted September 19, 2015 Just use a custom walker for nowdo you use localWalker.walk in a custom walker or just click points on the minimap? Quote Link to comment Share on other sites More sharing options...
Chris Posted September 19, 2015 Share Posted September 19, 2015 do you use localWalker.walk in a custom walker or just click points on the minimap? Custom walkers follows the same idea as local walker but doesn't spam click if ur not on the first position of the list It would be in a new class Walking.java Then I call it snide my script Walking walk = new Walking (); Then walk.walkpath (path here); @Sinatra Hey, So I'm writing a script and I tried using the osbot's local walker to walk a path but it always keeps spam clicking the first tile and doesn't walk any further. Is somebody else having this problem or is the local walker working fine for you? thanks in advance Something like this public class Walking { private Script scriptInstance; public Walking(Script scriptInstance){ this.scriptInstance = scriptInstance; } public void walkPath(Position[] path) throws InterruptedException { Position[] var5 = path; int var4 = path.length; for(int var3 = 0; var3 < var4; ++var3) { Position p = var5[var3]; boolean success; if(scriptInstance.myPosition().distance(p) <= 16 && scriptInstance.myPosition().distance(p) >= 3) { do { success = this.walkTile(p); } while(!success); } } } public boolean walkTile(Position p) throws InterruptedException { if(scriptInstance.myPosition().distance(p) > 13) { Position fail = new Position((p.getX() + scriptInstance.myPosition().getX()) / 2 + scriptInstance.random(-3, 3), (p.getY() + scriptInstance.myPosition().getY()) / 2 + scriptInstance.random(-3, 3), scriptInstance.myPosition().getZ()); this.walkTile(fail); } scriptInstance.mouse.click(new MiniMapTileDestination(scriptInstance.bot, p), false); int var3 = 0; while(scriptInstance.myPosition().distance(p) > 2 && var3 < 10) { scriptInstance.sleep(500L); if(!scriptInstance.myPlayer().isMoving()) { ++var3; } } return var3 != 10; } } Quote Link to comment Share on other sites More sharing options...
Ace Posted September 19, 2015 Author Share Posted September 19, 2015 Custom walkers follows the same idea as local walker but doesn't spam click if ur not on the first position of the list It would be in a new class Walking.java Then I call it snide my script Walking walk = new Walking (); Then walk.walkpath (path here); @Sinatra Something like this public class Walking { private Script scriptInstance; public Walking(Script scriptInstance){ this.scriptInstance = scriptInstance; } public void walkPath(Position[] path) throws InterruptedException { Position[] var5 = path; int var4 = path.length; for(int var3 = 0; var3 < var4; ++var3) { Position p = var5[var3]; boolean success; if(scriptInstance.myPosition().distance(p) <= 16 && scriptInstance.myPosition().distance(p) >= 3) { do { success = this.walkTile(p); } while(!success); } } } public boolean walkTile(Position p) throws InterruptedException { if(scriptInstance.myPosition().distance(p) > 13) { Position fail = new Position((p.getX() + scriptInstance.myPosition().getX()) / 2 + scriptInstance.random(-3, 3), (p.getY() + scriptInstance.myPosition().getY()) / 2 + scriptInstance.random(-3, 3), scriptInstance.myPosition().getZ()); this.walkTile(fail); } scriptInstance.mouse.click(new MiniMapTileDestination(scriptInstance.bot, p), false); int var3 = 0; while(scriptInstance.myPosition().distance(p) > 2 && var3 < 10) { scriptInstance.sleep(500L); if(!scriptInstance.myPlayer().isMoving()) { ++var3; } } return var3 != 10; }} thanks a lot, I'll try it out! 1 Quote Link to comment Share on other sites More sharing options...