vigco1 Posted January 9, 2015 Share Posted January 9, 2015 How to find out how many hitpoints NPC has left? Link to comment Share on other sites More sharing options...
Apaec Posted January 9, 2015 Share Posted January 9, 2015 npc.getHealth() ? 1 Link to comment Share on other sites More sharing options...
Savage Posted January 9, 2015 Share Posted January 9, 2015 Wiki maybe? I'm sure that you could Google that and find the answer somewhere! Link to comment Share on other sites More sharing options...
fixthissite Posted January 9, 2015 Share Posted January 9, 2015 (edited) 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 January 9, 2015 by fixthissite Link to comment Share on other sites More sharing options...
Valkyr Posted January 9, 2015 Share Posted January 9, 2015 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 1 Link to comment Share on other sites More sharing options...
Swizzbeat Posted January 9, 2015 Share Posted January 9, 2015 Just fetch from hiscores and calculate using #getHealth. Link to comment Share on other sites More sharing options...
Apaec Posted January 9, 2015 Share Posted January 9, 2015 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 You learn something new every day lol Link to comment Share on other sites More sharing options...
Joseph Posted January 10, 2015 Share Posted January 10, 2015 He never told us if it was a npc or a player Link to comment Share on other sites More sharing options...
fixthissite Posted January 10, 2015 Share Posted January 10, 2015 (edited) 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 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 January 10, 2015 by fixthissite Link to comment Share on other sites More sharing options...