Jump to content

Method to get current absorption points


Prolax

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

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.
Note: Your post will require moderator approval before it will be visible.

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