June 19, 20187 yr Hi, Is there a method to get the current absorption points? So you know when to sip an absorption potion. Many thanks. Prolax
June 19, 20187 yr 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()
June 19, 20187 yr Author 1 hour ago, Chris said: getWidgets() Ok thanks. I'm interested in how @Fruity implemented it.
June 19, 20187 yr 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, 20187 yr by aniki432789
June 20, 20187 yr 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.
June 20, 20187 yr 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.
June 20, 20187 yr 17 hours ago, Prolax said: Ok thanks. I'm interested in how @Fruity implemented it. Filter with geWidgets() is probably how he did it.
June 20, 20187 yr 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
June 20, 20187 yr Author 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.
June 20, 20187 yr 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, 20187 yr by HeyImJamie
June 21, 20187 yr 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, 20187 yr by 01053
June 21, 20187 yr 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.
June 21, 20187 yr Author Looks like myPlayer().getHealth() is deprecated, which method is now used to get the current health?
June 22, 20187 yr 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