mr bot420 Posted March 1, 2017 Share Posted March 1, 2017 (edited) I'm asking to see if it's possible to see how close you are to a specific tile. something like this: if (distanceTo(tile) <6) { bank(); }else{ webwalk(varrockeast); } I know syntax is not correct in example just looking to see if it is possible. I know you can check areas and such but i want to see if you can do it this way. In API I can only see distanceto entity. I'm probably being a bad. Can someone help? if you find it in api can you tell me where you found it too. thanks . EDIT: Would shift clicking be hard to implement too? wouldn't know where to start with this. Edited March 1, 2017 by mr bot420 Quote Link to comment Share on other sites More sharing options...
Saiyan Posted March 1, 2017 Share Posted March 1, 2017 use the.distance(entity) method when trying to calculate the distance e.g if(Banks.GRAND_EXCHANGE.getRandomPosition().distance(myPosition()) < 6) { //code } //another example private final Position alohaSnackbar = new Position(x,y,z); if(alohaSnackbar.distance(myPosition()) <= 6) //less than or equal to 6 { //code } 1 Quote Link to comment Share on other sites More sharing options...
Stimpack Posted March 1, 2017 Share Posted March 1, 2017 https://osbot.org/api/org/osbot/rs07/api/Map.html Map#distance(Entity entity) Returns absolute distance. Map#realDistance(Entity entity) Returns actual distance, as if walking to the Entity. If you can't reach it, I think this returns -1 1 Quote Link to comment Share on other sites More sharing options...
Saiyan Posted March 1, 2017 Share Posted March 1, 2017 21 minutes ago, mr bot420 said: I'm asking to see if it's possible to see how close you are to a specific tile. something like this: if (distanceTo(tile) <6) { bank(); }else{ webwalk(varrockeast); } I know syntax is not correct in example just looking to see if it is possible. I know you can check areas and such but i want to see if you can do it this way. In API I can only see distanceto entity. I'm probably being a bad. Can someone help? if you find it in api can you tell me where you found it too. thanks . EDIT: Would shift clicking be hard to implement too? wouldn't know where to start with this. P.S your player is a entity so .distance(entity) will apply to myPlayer().getPosition() or simply myPosition() both r the same thing i guess Quote Link to comment Share on other sites More sharing options...
Apaec Posted March 1, 2017 Share Posted March 1, 2017 1 hour ago, mr bot420 said: EDIT: Would shift clicking be hard to implement too? wouldn't know where to start with this. I think Alek added shift click dropping in the latest build, which is enabled only if your settings allow it. 1 Quote Link to comment Share on other sites More sharing options...