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.

PositionPolygon question

Featured Replies

i want to use position polygon to determine if it contains an entity. They have a method that accepts Vector3D. i looked into entity and they have a super of Vector3D. Vector3D and Position are the same thing except for it being different data types. 

 

so my question is how would i use the method contains(vector3d) with my entity? i already tryed putting the entity in the argument but it didnt work out.

u should read the documentation of it. hope this helps. You should probably explains "specifically" what you are trying to do' but based on what u wrote(clarify if im wrong), it seems you just wanna check if there is an entity on a tile? If so, then do a loop of npcs in your region and check the tile of the npc.

 

http://osbot.org/api/org/osbot/rs07/api/map/PositionPolygon.html

  • Author

u should read the documentation of it. hope this helps. You should probably explains "specifically" what you are trying to do' but based on what u wrote(clarify if im wrong), it seems you just wanna check if there is an entity on a tile? If so, then do a loop of npcs in your region and check the tile of the npc.

 

http://osbot.org/api/org/osbot/rs07/api/map/PositionPolygon.html

im trying to check to see if the entity is within that position polygon which they said it's the new "area wanna be class"

Edited by josedpay

i want to use position polygon to determine if it contains an entity. They have a method that accepts Vector3D. i looked into entity and they have a super of Vector3D. Vector3D and Position are the same thing except for it being different data types. 

 

so my question is how would i use the method contains(vector3d) with my entity? i already tryed putting the entity in the argument but it didnt work out.

 

 

 

You can pass a Position instead of Vector3D, so just do positionPolygon.contains(entity.getPosition()).

 

:)

  • Author

You can pass a Position instead of Vector3D, so just do positionPolygon.contains(entity.getPosition()).

 

smile.png

let me try it out real quick, it isnt working for me

Edited by josedpay

let me try it out real quick, it isnt working for me

 

Make sure you're importing the new Position/Entity and not the legacy.

PositionPolygon positionPolygon = new PositionPolygon();
Position p = new Position(0, 0, 0); 
if (positionPolygon.contains(p)) {
     //Whatever
}

Is working for me smile.png

Edited by Pandemic

  • Author

Make sure you're importing the new Position/Entity and not the legacy.

PositionPolygon positionPolygon = new PositionPolygon();
Position p = new Position(0, 0, 0); 
if (positionPolygon.contains(p)) {
     //Whatever
}

Is working for me smile.png

thanks for the help, i guess i did something wrong somewhere ill look into it later

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.