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.

Accurate Region Checking

Featured Replies

Haven’t found a clean solution to check what region my player is in. 

At the moment using getMap().getBaseX() and getMap().getBaseY() but this varies slightly depending on how my player accessed the position in the region.

With a rough calc I’m able to work it out, but as I said it’s a bit dirty. Are there any cleaner solutions? 

Edited by jca

  • Author
7 minutes ago, Eliot said:

getMap().getRegion()

As far I’m aware that doesn’t give any information that helps you identify the region you’re currently in. It only gives you access to getClippingPlanes() and getTiles()... 

9 hours ago, jca said:

As far I’m aware that doesn’t give any information that helps you identify the region you’re currently in. It only gives you access to getClippingPlanes() and getTiles()... 

What info are you trying to get about the region?

  • Author

Identify the region my player is in so I can then perform logic, for example @Eliot

if ( isInRegion(region) ){

  doA();

} else { 

  doB();

}

 

Edited by jca

1 hour ago, jca said:

Identify the region my player is in so I can then perform logic, for example @Eliot


if ( isInRegion(region) ){

  doA();

} else { 

  doB();

}

 

Why not just use areas?

 

if (area.contains(myPlayer()) {
     ...
}

 

Edited by Eliot

  • Author
6 minutes ago, Eliot said:

Why not just use areas?

 


if (area.contains(myPlayer()) {
     ...
}

 

Yeah... well that’s one option. 

The area I need to check is huge (the size of the region, basically 104x104). My logic is if it’s already defined as a region and I could check that then it makes more sense then defining a massive area. 

But if there’s not really a better way then areas will have to do. 

5 minutes ago, jca said:

Yeah... well that’s one option. 

The area I need to check is huge (the size of the region, basically 104x104). My logic is if it’s already defined as a region and I could check that then it makes more sense then defining a massive area. 

But if there’s not really a better way then areas will have to do. 

You don't need to define the area. Since it's big just get the bottom left and top right coordinates and that's all you need to check and see if you're within an area.

  • Author
3 minutes ago, dreameo said:

You don't need to define the area. Since it's big just get the bottom left and top right coordinates and that's all you need to check and see if you're within an area.

That’s still defining an area... it’s not an issue. Just if there was an option with regions it feels better to use. But maybe it’s not possible. 

1 minute ago, jca said:

That’s still defining an area... it’s not an issue. Just if there was an option with regions it feels better to use. But maybe it’s not possible. 

You made it sound like it's an issue when you said the area is large. Which I said, you don't need to actually define an area.. you just need 2 coordinates.

You're doing the same with with a region that you would with an area. Idk why you're hard stuck on regions.

  • Author
6 minutes ago, dreameo said:

You made it sound like it's an issue when you said the area is large. Which I said, you don't need to actually define an area.. you just need 2 coordinates.

You're doing the same with with a region that you would with an area. Idk why you're hard stuck on regions.

Ah I’m not really, I just wondered if there was a way. Again, theoretically dealing with a large area feels like it should be handled by region checking. 

But I can stick with areas, thanks for your thoughts and @Eliot

Edited by jca

Create an account or sign in to comment

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.