Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • getHealthPercent() is bugged!


    WolfsRain

    Recommended Posts

    My BOT started the script having 5/10 of health. If you call this function, even having half the actual max health, it will recall that your health is 100% and go downwards as you take hits

    In the .jpg I show the test.

     

    CODE:

    public int onLoop()

    {

              log("[DANGER] " + getLocalPlayer().getHealthPercent());

    }

     

     

    evidence.JPG

    Link to comment
    Share on other sites

    I mean between the roofs, your account eating, and it logging 100 3 seconds later I'm not entirely sure what you're actually showing in your test.

    It should be working fine (it works fine on NPC's and such) but I do know it only displays the correct % if your health bar is visible, which is just part of the game itself.

    As man said though, if you're trying to get accurate results for your own character, use the combat class or check your stats.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.