combat_acc Posted October 27, 2016 Posted October 27, 2016 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/
House Posted October 27, 2016 Posted October 27, 2016 Your question is way too broad.Include your specific code you want to modify or that is not working
Zappster Posted October 27, 2016 Posted October 27, 2016 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 { 1
Saiyan Posted October 27, 2016 Posted October 27, 2016 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; } 1