October 27, 20169 yr how do i make script eat then continue task it was doing before? im trying edit this script (the one that controls accounts in cc) http://osbot.org/forum/topic/107749-open-source-for-sorc-garden-zapps-army/
October 27, 20169 yr Your question is way too broad.Include your specific code you want to modify or that is not working
October 27, 20169 yr Step 1. Create the function to eat + check health, something like private void eat(){ if(myPlayer().getHealth < 40){ inventory.interact("Eat","Lobster"); } } Then you would add the call right under this line: public int onLoop() throws InterruptedException {
October 27, 20169 yr public int onLoop() throws InterruptedException { if(myPlayer().getHealthPercent() <= 50) { if(getInventory().contains(item -> item.hasAction("Eat")) { getInventory().getItem(item -> item.hasAction("Eat").interact("Eat")); } else { log("out of food"); } } return 300; }
Create an account or sign in to comment