fre024 Posted May 18, 2014 Share Posted May 18, 2014 (edited) Hello all, i am trying to change the setMinDistanceThreshold but it keeps giving me errors, no matter what i try STATUS: SOLVED i use another method more accurate to the last tile. Event.WalkingEvent(AREA.getRandomPosition(0)).setMinDistanceTreshold(0); map.walk(AREA); Edited May 19, 2014 by fre024 Link to comment Share on other sites More sharing options...
Extreme Scripts Posted May 18, 2014 Share Posted May 18, 2014 Hello all, i am trying to change the setMinDistanceThreshold but it keeps giving me errors, no matter what i try Paste your code. Link to comment Share on other sites More sharing options...
Guest Apogee Posted May 18, 2014 Share Posted May 18, 2014 I've never bothered with this. Unable to help here, sorry. :c Link to comment Share on other sites More sharing options...
Th3 Posted May 18, 2014 Share Posted May 18, 2014 localWalker.walk(new Position(1,1,1)); You mean this? Link to comment Share on other sites More sharing options...
fre024 Posted May 19, 2014 Author Share Posted May 19, 2014 code posted in original post Link to comment Share on other sites More sharing options...
Extreme Scripts Posted May 19, 2014 Share Posted May 19, 2014 (edited) Event.WalkingEvent(AREA.getRandomPosition(0)).setMinDistanceTreshold(0); map.walk(AREA); Use the localWalker class, all you need is: localWalker.walk(AREA.getRandomPosition(0)); Edited May 19, 2014 by Divinity Link to comment Share on other sites More sharing options...
fre024 Posted May 19, 2014 Author Share Posted May 19, 2014 Use the localWalker class, all you need is: localWalker.walk(AREA.getRandomPosition(0)); and how do i make it walk to that exact position? it always stops 2 tiles from the position it needs to be can i use: setMinDistanceTreshold(0); Link to comment Share on other sites More sharing options...
Extreme Scripts Posted May 19, 2014 Share Posted May 19, 2014 and how do i make it walk to that exact position? it always stops 2 tiles from the position it needs to be can i use: Are you sure it steps 2 tiles from that position? RandomPosition will just return any coordinate in that area, so unless your debugging the coordinate I don't see how you would know? If you are debugging it and it still steps 2 steps before, then it's a bug with the walking class in OSBot 2, remember it's not a final release so there are bound to be imperfections. Link to comment Share on other sites More sharing options...
Guest Apogee Posted May 19, 2014 Share Posted May 19, 2014 What are the coordinates you want to finish at? Link to comment Share on other sites More sharing options...
fre024 Posted May 19, 2014 Author Share Posted May 19, 2014 I use an area that is 1 tile. I also tried walking to the specified position with the same result, 2 tiles away from endposition. Default setMinDistanceTreshold is set to 2 for every walking procedure right? I want to set this to 0. Link to comment Share on other sites More sharing options...
Ericthecmh Posted May 19, 2014 Share Posted May 19, 2014 Are you sure it steps 2 tiles from that position? RandomPosition will just return any coordinate in that area, so unless your debugging the coordinate I don't see how you would know? If you are debugging it and it still steps 2 steps before, then it's a bug with the walking class in OSBot 2, remember it's not a final release so there are bound to be imperfections. No it's not a bug, it's just that the script stops within the threshold difference... there's no walkExact method anymore, for whatever reason. I use an area that is 1 tile. I also tried walking to the specified position with the same result, 2 tiles away from endposition. Default setMinDistanceTreshold is set to 2 for every walking procedure right? I want to set this to 0. I contact a developer and see if I can convince them to readd the walkExact method into the OSBot 2 API. For now though, when I needed it to walk exactly, I use localWalker to get near enough then I do the following: Position position = new Position(x, y, z); position.interact(bot, "Walk here"); It'll click on the tile on screen, with camera rotation if necessary. This will ensure that you walk to the desired location exactly. Link to comment Share on other sites More sharing options...
Th3 Posted May 19, 2014 Share Posted May 19, 2014 (edited) No it's not a bug, it's just that the script stops within the threshold difference... there's no walkExact method anymore, for whatever reason. I contact a developer and see if I can convince them to readd the walkExact method into the OSBot 2 API. For now though, when I needed it to walk exactly, I use localWalker to get near enough then I do the following: Position position = new Position(x, y, z); position.interact(bot, "Walk here"); It'll click on the tile on screen, with camera rotation if necessary. This will ensure that you walk to the desired location exactly. you can also write your own, I found local walker to be too buggy. public boolean walkMinimap(Position p) { MouseDestination mouseDestination = new MiniMapTileDestination(bot,p); if (mouseDestination != null) { return mouse.click(mouseDestination); } return false; } usage: if (walkMinimap(new Position(3022,3022,0) { //blah } Edited May 19, 2014 by Th3 Link to comment Share on other sites More sharing options...
Ericthecmh Posted May 19, 2014 Share Posted May 19, 2014 you can also write your own, I found local walker to be too buggy. public boolean walkMinimap(Position p) { MouseDestination mouseDestination = new MiniMapTileDestination(bot,p); if (mouseDestination != null) { return mouse.click(mouseDestination); } return false; } usage: if (walkMinimap(new Position(3022,3022,0) { //blah } The local walker has always been fine for me... idk Link to comment Share on other sites More sharing options...
Th3 Posted May 19, 2014 Share Posted May 19, 2014 The local walker has always been fine for me... idk Until you run into this. http://osbot.org/forum/topic/50183-osbot-188-and-213/?p=563210 Which happens in quiet a few regions and tiles that are diagonal, slanted or on a hill. Link to comment Share on other sites More sharing options...