Jump to content
Prolax

Method to get current absorption points

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...