Adding an eat feature to my Fighting Bot in Software & Script Development Discussion Posted June 3, 2022 Don't know if you are still having issues but it could be this. else if (getAPIContext().localPlayer().getHealthPercent()) { eat(); In the ELSE IF at the bottom, this just gets the Health Percent, you will need to check it against a value like such. else if (getAPIContext().localPlayer().getHealthPercent() <= 50) { eat(); This will check if your health is less than 50 and then call the eat() function.
Adding an eat feature to my Fighting Bot
in Software & Script Development Discussion
Posted
Don't know if you are still having issues but it could be this.
else if (getAPIContext().localPlayer().getHealthPercent()) { eat();
In the ELSE IF at the bottom, this just gets the Health Percent, you will need to check it against a value like such.
else if (getAPIContext().localPlayer().getHealthPercent() <= 50) { eat();
This will check if your health is less than 50 and then call the eat() function.