1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bug .getHealthGauge not working

Discussion in 'Developer Support' started by tyb51, May 15, 2017.

  1. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    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.

    Code (Text):
    1. Boolean hasTarget = Players.getLocal().getTarget() !=null;
    2.         if(hasTarget) {
    3.             bot.getLogger().info("Target acquired");
    4.             CombatGauge hp = Players.getLocal().getTarget().getHealthGauge();
    5.             if (hp != null) {
    6.                 bot.getLogger().info("Target hp: " + hp.getPercent());
    7.                 return hp.getPercent() >15;
    8.             }
    9.             bot.getLogger().info("Combat gauge not found");
    10.         }
    11.         return false;
    Code (Text):
    1. 00:00:11 INFO    Target hp: 100
    2. 00:00:12 INFO    ability is null
    3. 00:00:12 INFO    Target acquired
    4. 00:00:12 INFO    Target hp: 100
    5. 00:00:12 INFO    Target acquired
    6. 00:00:12 INFO    Target hp: -1
    7. 00:00:13 INFO    Target acquired
    8. 00:00:13 INFO    Target hp: -1
    --- Double Post Merged, May 15, 2017, Original Post Date: May 2, 2017 ---
    @Party
     
  2. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Fixed in the next release.
    --- Double Post Merged, May 18, 2017, Original Post Date: May 17, 2017 ---
    Please confirm it's fixed.
     
    tyb51 likes this.
  3. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    It is! although sometimes i get results higher then 100%
     
  4. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Can you show me some examples and ways to reproduce it?
     
  5. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    Code (Text):
    1. 00:30:28 INFO    Target hp: 111
    2. 00:30:39 INFO    Target acquired
    3. 00:30:39 INFO    Target hp: 111
    4. 00:30:44 INFO    Target acquired
    5. 00:30:44 INFO    Target hp: 87
    6. 00:30:47 INFO    Target acquired
    7. 00:30:47 INFO    Target hp: 87
    8. 00:30:52 INFO    Target acquired
    9. 00:30:52 INFO    Target hp: 87
    Code (Text):
    1.    target =  Players.getLocal().getTarget();
    2.         if(target !=null) {
    3.             bot.getLogger().info("Target acquired");
    4.             CombatGauge hp = target.getHealthGauge();
    5.             if (hp != null) {
    6.                 bot.getLogger().info("Target hp: " + hp.getPercent());
    7.                 return hp.getPercent() >10;
    8.             }
    9.             bot.getLogger().info("Combat gauge not found");
    10.             return true;
    11.         }
    reproducing it just when fighting
     
  6. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    When fighting what though... I need as much context as you can provide me with otherwise this bug won't be able to be fixed completely.
     
  7. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    Srry i forgot about answering this. It happens with every monster, no exceptions. I think it is wrongly calibrated so that 111 is max health. Never seen anything over. Lowest I saw was returning 3 (when scrolling through a log of about an hour), so i think lower limit is correct(0).
     

Share This Page

Loading...