Jump to content

How to get NPCs hitpoints


vigco1

Recommended Posts

You should really learn how to read the API documentation, which this site provides you in the navigation bar. I'm not a script developer, but as a programmer, I can dig into the API, find the NPC class's method summary and see that it inherits a getHealth() method (as Apaec mentioned) from Character.

 

 

Edited by fixthissite
Link to comment
Share on other sites

npc.getHealth() ?

 

 

You should really learn how to read the API documentation, which this site provides you in the navigation bar. I'm not a script developer, but as a programmer, I can dig into the API, find the NPC class's method summary and see that it inherits a getHealth() method (as Apaec mentioned) from Character.

getHealth returns the health as a percentage, I think he means to get the actual number of hitpoints remaining. There is no way to do this, only for players by getting the skillTracker.getDynamicLevel(SKILL) method. Maybe someone else needs to read the API :doge:

 

18b9955faf.png

  • Like 1
Link to comment
Share on other sites

getHealth returns the health as a percentage, I think he means to get the actual number of hitpoints remaining. There is no way to do this, only for players by getting the skillTracker.getDynamicLevel(SKILL) method. Maybe someone else needs to read the API :doge:

18b9955faf.png

Why would you need to get the NPC's health maximum? I mean like I said, I don't know much about botting, but I personally don't see a reason for it, and apparently the API designers thought so too. Seems as if he should refer to the XY problem, and explain exactly what he wants to do.

From playing RuneScape in the past, the only health related situations referred to eating and possibly running away (if your health is low or if the opponent's health is high). This is why I believe the actual amount of hitpoints was never added to the API, seeing how it seems to be a reasonable thing to add, and percentage was added instead.

Plus, he never mentioned that he already checked the API, so as far as we know, he doesn't know it exists. I was giving a quick introduction. No need to be rude..

Edited by fixthissite
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...