So I took the skeleton from the topic in tutorials and I wanted to know what I have to do to make my bot eat under a certain hp
This is the snippet of code.
NPC kurask = npcs.closest("Kurask");
if(kurask != null){
kurask.interact("Attack");
getGroundItems().closest(loot).interact("Take");
if (getSkills().getDynamic(Skill.HITPOINTS) > random(20,getSkills().getStatic(Skill.HITPOINTS)-22)){
Also if you know a formula that works well for calculating what hp to eat at I would love to know.