Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Position in front of player

Featured Replies

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 happy.png

 

Edit: Requested through pm- http://osbot.org/api/org/osbot/rs07/api/model/Character.html#getInteracting()

get your position, get your rotation, remove or add 1 to your position's x and/or y coordinate based on that rotation.

Edited by Botrepreneur

  • Author

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 happy.png

 

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?

  • Author

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;
	}

 

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 :D

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.