Thanks alot guys~
if(cowArea.contains(myPlayer())) {
NPC cow = getNpcs().closest("Cow", "Cow calf");
if (cow != null && !combat.isFighting() && !cow.isUnderAttack()) {
cow.interact("Attack");
new ConditionalSleep(5000) {
@@Override
public boolean condition() throws InterruptedException {
return myPlayer().isAnimating() || myPlayer().isInteracting(cow);
}
}.sleep();
}
is what i used.
I have one last problem. For some reason it takes a LONG time to loot cowhide/choose a different NPC (after killing cow, finding out someone already attking it or if it's under attk.)
thanks