Jump to content

Loot item before Starting another attack.


Recommended Posts

Posted

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

Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...