//Combat script
//food and enemy should be predefined colors that are set in the GUI
while(scriptEnabled) {
if(pHealth() / pMaxHealth() > 0.30) { //if player has more than 30% health
if(!pIsInCombat()) { //player is not in combat
clickColor(enemy); //find and click color of enemy
Sleep(3000);
}
} else {
if(iGetCount("Lobster") > 0) { //does inventory have a lobster
if(tabOpened() == 4) {; //is inventory tab opened
clickColor(food); //find and click color of food
Sleep(2000);
} else {
clickTab(4); //open the inventory tab
Sleep(1500);
}
} else {
logout(); //method that automatically clicks logout icon, then clicks logout
pause();
}
}
}
