Health Api

Discussion in 'Tutorials & Resources' started by frazboyz, Aug 4, 2014.

  1. Use n abuse.

    Code (Text):
    1. public static int getHealth() {
    2.         final InterfaceComponent ic = Interfaces.getAt(1430, 4, 7);
    3.         if (ic != null && ic.getText() != null) {
    4.             return Integer.parseInt(ic.getText().trim().split("/")[0]);
    5.         }
    6.         return -1;
    7.     }
    8.  
    9.     public static int getTotalHealth() {
    10.         final InterfaceComponent ic = Interfaces.getAt(1430, 4, 7);
    11.         if (ic != null && ic.getText() != null) {
    12.             return Integer.parseInt(ic.getText().trim().split("/")[1]);
    13.         }
    14.         return -1;
    15.     }
    16.  
    17.     public static int getHealthPercent() {
    18.         return (getHealth() / getTotalHealth()) * 100;
    19.     }
     
  2. Probably easier to make use of the skill class methods such getCurrentLevel() and getBaseLevel().
    Great share none the less :)
     
    Exile likes this.
  3. Code (Text):
    1.  
    2. int healthPercent = Players.getLocal().getHealthGauge().getPercent();
    3.  
     
  4. From what i belive it only works in combat unless its currently broken.
    I guess... but im pretty sure gear alters your health in rs3 so using your level isnt accurate.
     
  5. I don't see a reason to get the current HP level if not in combat :D

    Not anymore since the Legacy update, it removed health-boosting armour.
     
  6. Im suprised about no health boosting items xD also, for things like recharging your health at the bank etc.
     
  7. Goes automatically, when you enter any bank in RuneScape your health is restored to 100% without doing anything :p
    (Don't ask me why, test it out & you'll see)
     
  8. ActionBar.getHealth(), getMaxHealth(), etc...
     

Share This Page

Loading...