May 19, 201510 yr 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
May 20, 201510 yr 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.
Create an account or sign in to comment