scary123 Posted May 19, 2015 Share Posted May 19, 2015 So LOOT and KILL cases (not working) : case LOOT: GroundItem cowhide = groundItems.closest("Cowhide"); if(cowhide != null && !myPlayer().isAnimating() && !myPlayer().isUnderAttack() ) { log("Picking up hides!..."); cowhide.interact("Take"); return random(100, 200); } else { camera.toEntity(cowhide); } case KILL: NPC cow = npcs.closest("Cow","Cow calf"); if ((cow != null) && (cow.isAttackable())) { log("Attacking the Cow!..."); cow.interact("Attack"); break; } else { camera.toEntity(cow); } Would it be possible to combine these two, result being, after it attacks the cow it waits for the drop to show up on the ground, LOOT the cowhide and only then move on to the next cow.Being trying to get things to work for 2days non stop, seriously low gains. ;D Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 20, 2015 Share Posted May 20, 2015 The logic here is overall very flawed If cow/cowhide is not null (aka. it exists), you do stuff with it, and if not, you move the camera to it. Please explain to me how one moves the camera to something that does not exist :L For your actual question; you could either modify your getState method to not pick another fight while there is cowhide on the ground; or you could add a cowhide check to the KILL case. Quote Link to comment Share on other sites More sharing options...
scary123 Posted May 20, 2015 Author Share Posted May 20, 2015 You are right. Thanks. Quote Link to comment Share on other sites More sharing options...