Prolax Posted June 19, 2018 Share Posted June 19, 2018 Hi, Is there a method to get the current absorption points? So you know when to sip an absorption potion. Many thanks. Prolax Quote Link to comment Share on other sites More sharing options...
Chris Posted June 19, 2018 Share Posted June 19, 2018 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() Quote Link to comment Share on other sites More sharing options...
Prolax Posted June 19, 2018 Author Share Posted June 19, 2018 1 hour ago, Chris said: getWidgets() Ok thanks. I'm interested in how @Fruity implemented it. Quote Link to comment Share on other sites More sharing options...
aniki432789 Posted June 19, 2018 Share Posted June 19, 2018 (edited) 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 June 19, 2018 by aniki432789 Quote Link to comment Share on other sites More sharing options...
d0zza Posted June 20, 2018 Share Posted June 20, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
Canidae Posted June 20, 2018 Share Posted June 20, 2018 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. Quote Link to comment Share on other sites More sharing options...
Chris Posted June 20, 2018 Share Posted June 20, 2018 17 hours ago, Prolax said: Ok thanks. I'm interested in how @Fruity implemented it. Filter with geWidgets() is probably how he did it. Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted June 20, 2018 Share Posted June 20, 2018 Have you tried getAbsorbtionPoints(); 1 Quote Link to comment Share on other sites More sharing options...
Juggles Posted June 20, 2018 Share Posted June 20, 2018 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 Quote Link to comment Share on other sites More sharing options...
Prolax Posted June 20, 2018 Author Share Posted June 20, 2018 3 hours ago, HeyImJamie said: Have you tried getAbsorbtionPoints(); 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. Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted June 20, 2018 Share Posted June 20, 2018 (edited) 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 June 20, 2018 by HeyImJamie Quote Link to comment Share on other sites More sharing options...
01053 Posted June 21, 2018 Share Posted June 21, 2018 (edited) 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 June 21, 2018 by 01053 Quote Link to comment Share on other sites More sharing options...
Prolax Posted June 21, 2018 Author Share Posted June 21, 2018 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. Quote Link to comment Share on other sites More sharing options...
Prolax Posted June 21, 2018 Author Share Posted June 21, 2018 Looks like myPlayer().getHealth() is deprecated, which method is now used to get the current health? Quote Link to comment Share on other sites More sharing options...
FrostBug Posted June 22, 2018 Share Posted June 22, 2018 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 Quote Link to comment Share on other sites More sharing options...