combat_acc Posted October 27, 2016 Share 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/ Quote Link to comment Share on other sites More sharing options...
House Posted October 27, 2016 Share Posted October 27, 2016 Your question is way too broad.Include your specific code you want to modify or that is not working Quote Link to comment Share on other sites More sharing options...
Zappster Posted October 27, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Saiyan Posted October 27, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...