todamach Posted June 27, 2014 Share Posted June 27, 2014 Hey, maybe someone has a method that returns position in front of a player? Link to comment Share on other sites More sharing options...
Extreme Scripts Posted June 27, 2014 Share Posted June 27, 2014 Hey, maybe someone has a method that returns position in front of a player? Why would you need this? If you're trying to find out if you're interacting with an entity then it can be found in the API, let me know and i'll point you to it Edit: Requested through pm- http://osbot.org/api/org/osbot/rs07/api/model/Character.html#getInteracting() Link to comment Share on other sites More sharing options...
Botre Posted June 27, 2014 Share Posted June 27, 2014 (edited) get your position, get your rotation, remove or add 1 to your position's x and/or y coordinate based on that rotation. Edited June 27, 2014 by Botrepreneur Link to comment Share on other sites More sharing options...
todamach Posted June 27, 2014 Author Share Posted June 27, 2014 Why would you need this? If you're trying to find out if you're interacting with an entity then it can be found in the API, let me know and i'll point you to it Edit: Requested through pm- http://osbot.org/api/org/osbot/rs07/api/model/Character.html#getInteracting() getInteractingpublic Character<?> getInteracting()Gets the character that this character is currently facing/interacting. Returns: The character. I scrolled throught this sooooo many times. What is character exactly? Isn't it player or smth? Link to comment Share on other sites More sharing options...
Botre Posted June 27, 2014 Share Posted June 27, 2014 I scrolled throught this sooooo many times. What is character exactly? Isn't it player or smth? Link to comment Share on other sites More sharing options...
todamach Posted June 27, 2014 Author Share Posted June 27, 2014 thanks. Method, if someone might be interested: public Position positionInFront(){ int dir = myPlayer().getRotation()/256; Position myPos = myPlayer().getPosition(); Position pos = null; if(dir == 0){ pos = new Position(myPos.getX(),myPos.getY()-1,myPos.getZ()); }else if(dir==2){ pos = new Position(myPos.getX()-1,myPos.getY(),myPos.getZ()); }else if(dir == 4){ pos = new Position(myPos.getX(),myPos.getY()+1,myPos.getZ()); }else if (dir == 6){ pos = new Position(myPos.getX()+1,myPos.getY(),myPos.getZ()); } return pos; } Link to comment Share on other sites More sharing options...
Joseph Posted June 27, 2014 Share Posted June 27, 2014 thanks. Method, if someone might be interested: public Position positionInFront(){ int dir = myPlayer().getRotation()/256; Position myPos = myPlayer().getPosition(); Position pos = null; if(dir == 0){ pos = new Position(myPos.getX(),myPos.getY()-1,myPos.getZ()); }else if(dir==2){ pos = new Position(myPos.getX()-1,myPos.getY(),myPos.getZ()); }else if(dir == 4){ pos = new Position(myPos.getX(),myPos.getY()+1,myPos.getZ()); }else if (dir == 6){ pos = new Position(myPos.getX()+1,myPos.getY(),myPos.getZ()); } return pos; } i dont need it but nice Link to comment Share on other sites More sharing options...
Pseudo Posted June 28, 2014 Share Posted June 28, 2014 I'm assuming you're writing a Sorceress' garden script then? Link to comment Share on other sites More sharing options...