Rubick 30 Posted August 3, 2017 I've got an issue where getHealthPercent() returns 100 no matter what. I've got a log printing it's value and I'm looking at my character at 10% HP. What's up with it? Pretty sure it worked before. Also what's up with the suggested method being struck out in IntelliJ? Edit: Apparently getHealthPercent() is only when in combat, and apparently this is the workaround: getSkills().getBoostedLevels(Skill.HITPOINTS) But it returns the current health points, which makes things tricky when using accounts with different HP levels, but it will do. Edit 2: This is what I needed, works outside of combat and returns a percent instead of the HP integer. getCombat().getHealthPercent()
ikiddoi 14 Posted August 3, 2017 https://dreambot.org/forums/index.php/topic/5954-script-not-stopping-eating/
Rubick 30 Author Posted August 3, 2017 https://dreambot.org/forums/index.php/topic/5954-script-not-stopping-eating/ Ah, thanks!
Genius 50 Posted August 4, 2017 I've got an issue where getHealthPercent() returns 100 no matter what. I've got a log printing it's value and I'm looking at my character at 10% HP. What's up with it? Pretty sure it worked before. Also what's up with the suggested method being struck out in IntelliJ? Edit: Apparently getHealthPercent() is only when in combat, and apparently this is the workaround: getSkills().getBoostedLevels(Skill.HITPOINTS) But it returns the current health points, which makes things tricky when using accounts with different HP levels, but it will do. Struck out methods are deprecated, meaning you shouldn't attempt to use them.
Rubick 30 Author Posted August 4, 2017 Struck out methods are deprecated, meaning you shouldn't attempt to use them. I figured i was just curious! Thanks.
Pandemic 2852 Posted August 5, 2017 If you're checking the health percent for your local player only, you can use getCombat().getHealthPercent() as it will always work and is based on your skills.
Rubick 30 Author Posted August 5, 2017 getCombat().getHealthPercent() works just fine though If you're checking the health percent for your local player only, you can use getCombat().getHealthPercent() as it will always work and is based on your skills. Thanks gents, works perfect. Should have edited post showing i found this.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.