- Joined
- Dec 23, 2015
- Messages
- 1,104
- Thread Author
- #1
RS3 CombatGauge:
As the title says, The .getHealthGauge method is not functioning properly. Not for Npc's nor for the player (the latter not being a problem because of Health.getCurrentPercent())
Below an example of the bot code and the debug log. The jump between 100 an -1 is NOT because target is dead but it turns -1 after it gets damaged.
@Party
As the title says, The .getHealthGauge method is not functioning properly. Not for Npc's nor for the player (the latter not being a problem because of Health.getCurrentPercent())
Below an example of the bot code and the debug log. The jump between 100 an -1 is NOT because target is dead but it turns -1 after it gets damaged.
Code:
Boolean hasTarget = Players.getLocal().getTarget() !=null;
if(hasTarget) {
bot.getLogger().info("Target acquired");
CombatGauge hp = Players.getLocal().getTarget().getHealthGauge();
if (hp != null) {
bot.getLogger().info("Target hp: " + hp.getPercent());
return hp.getPercent() >15;
}
bot.getLogger().info("Combat gauge not found");
}
return false;
Code:
00:00:11 INFO Target hp: 100
00:00:12 INFO ability is null
00:00:12 INFO Target acquired
00:00:12 INFO Target hp: 100
00:00:12 INFO Target acquired
00:00:12 INFO Target hp: -1
00:00:13 INFO Target acquired
00:00:13 INFO Target hp: -1
@Party