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.

Method to get current absorption points

Featured Replies

Hi,

Is there a method to get the current absorption points? So you know when to sip an absorption potion.

Many thanks.
Prolax

11 minutes ago, Prolax said:

Hi,

Is there a method to get the current absorption points? So you know when to sip an absorption potion.

Many thanks.
Prolax

getWidgets()

something like:

 

absorpWidget = getWidgets().get(202, 1, 9);

....

currentAbsorp = Integer.parseInt(absorpWidget.getMessage());

 

 

Take the time to learn and understand how widgets work and how to use them.

Edited by aniki432789

9 hours ago, Prolax said:

Ok thanks.

I'm interested in how @Fruity implemented it.

Fruity would've implemented it using widgets. There's no magic method that gets absorption points.

12 hours ago, aniki432789 said:

something like:

 

absorpWidget = getWidgets().get(202, 1, 9);

....

currentAbsorp = Integer.parseInt(absorpWidget.getMessage());

 

 

Take the time to learn and understand how widgets work and how to use them.

Since widget IDs tend to change, you should use something different instead. For example text color, position or something else.

17 hours ago, Prolax said:

Ok thanks.

I'm interested in how @Fruity implemented it.

Filter with geWidgets() is probably how he did it.

widget 

convert to int

make sure you remove "," else it will null when at 1,000

 

as Jamie said above, could just leech off Alek and do getNMZ().leech().getAbsorbPoints

  • Author
3 hours ago, HeyImJamie said:

Have you tried getAbsorbtionPoints(); :boge: 

 

2 hours ago, Juggles said:

widget 

convert to int

make sure you remove "," else it will null when at 1,000

 

as Jamie said above, could just leech off Alek and do getNMZ().leech().getAbsorbPoints

I'll suggest this to @Alek.

11 minutes ago, Prolax said:

 

I'll suggest this to @Alek.

Please don't.

Just learn to use Widgets and make your own method.

Edited by HeyImJamie

    public int getCurrentAbsorptionLevel() {
        final RS2Widget widget = script.getWidgets().get(202, 1, 9);
        if (widget != null && widget.isVisible() && widget.getMessage() != null)
            return Integer.parseInt(widget.getMessage().replace(",", ""));
        return 0;
    }

Should work.

Edited by 01053

  • Author
2 hours ago, 01053 said:

    public int getCurrentAbsorptionLevel() {
        final RS2Widget widget = script.getWidgets().get(202, 1, 9);
        if (widget != null && widget.isVisible() && widget.getMessage() != null)
            return Integer.parseInt(widget.getMessage().replace(",", ""));
        return 0;
    }

Should work.

Thanks, I'll write my script this weekend and post it here.

  • Author

Looks like myPlayer().getHealth() is deprecated, which method is now used to get the current health?

On 6/21/2018 at 3:11 PM, Prolax said:

Looks like myPlayer().getHealth() is deprecated, which method is now used to get the current health?

getHealthPercent() and getHealthPercentCache() aren't deprecated

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.