PrimoFernando 7 Share Posted April 1, 2015 (edited) hey, I'm with some issues in my script when it reaches the bank it eats half of the inventory even if full health i want it to eat when it reaches 40% of the health. My EatNode: public class EatNode extends TaskNode { @Override public boolean accept() { return UserSettings.guiPrepared && getLocalPlayer().getHealthPercent() < 40 && getInventory().contains(UserSettings.foodName) && UserSettings.eatChecked; } @Override public int execute() { getInventory().interact(UserSettings.foodName, "Eat"); return (int) Calculations.gRandom(1000, 200); } } what i have wrong in here? Edited April 1, 2015 by PrimoFernando Link to comment Share on other sites More sharing options...
Zawy 849 Share Posted April 1, 2015 Just use this; if(getSkills().getBoostedLevels(Skill.HITPOINTS) < 50){ getInventory().interact(foodname,"Eat"); sleep(+Calculations.random(500,800)); } PrimoFernando 1 Link to comment Share on other sites More sharing options...
PrimoFernando 7 Author Share Posted April 1, 2015 Just use this; if(getSkills().getBoostedLevels(Skill.HITPOINTS) < 50){ getInventory().interact(foodname,"Eat"); sleep(+Calculations.random(500,800)); } thanks man the method getLocalPlayer().getHealthPercent() must be broke right? Link to comment Share on other sites More sharing options...
Notorious 341 Share Posted April 1, 2015 thanks man the method getLocalPlayer().getHealthPercent() must be broke right? Actually that call uses player.getHealth() hook, which is only active while in combat. Though we do have a call so you can use your skills for a health percentage rather than your current combat health, just call: getCombat().getHealthPercent(); //Click for the JavaDoc info PrimoFernando 1 Link to comment Share on other sites More sharing options...
PrimoFernando 7 Author Share Posted April 1, 2015 Actually that call uses player.getHealth() hook, which is only active while in combat. Though we do have a call so you can use your skills for a health percentage rather than your current combat health, just call: getCombat().getHealthPercent(); //Click for the JavaDoc info thanks notorious, that 2 methods cause confusion it's better to add some notes to getLocalPlayer().getHealthPercent() in api. Link to comment Share on other sites More sharing options...
Waseb 5 Share Posted April 1, 2015 Y'all are so confusing.. Link to comment Share on other sites More sharing options...
Recommended Posts