Rubick 30 Share 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() Link to comment Share on other sites More sharing options...
ikiddoi 13 Share Posted August 3, 2017 https://dreambot.org/forums/index.php/topic/5954-script-not-stopping-eating/ Link to comment Share on other sites More sharing options...
Rubick 30 Author Share Posted August 3, 2017 https://dreambot.org/forums/index.php/topic/5954-script-not-stopping-eating/ Ah, thanks! Link to comment Share on other sites More sharing options...
Genius 49 Share 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. Link to comment Share on other sites More sharing options...
Rubick 30 Author Share Posted August 4, 2017 Struck out methods are deprecated, meaning you shouldn't attempt to use them. I figured i was just curious! Thanks. Link to comment Share on other sites More sharing options...
Xephy 237 Share Posted August 5, 2017 getCombat().getHealthPercent() works just fine though Link to comment Share on other sites More sharing options...
Pandemic 2703 Share 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. Link to comment Share on other sites More sharing options...
Rubick 30 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.