Jump to content
scary123

Loot item before Starting another attack.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

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