import bot.*;
public class Chickens extends Methods {
	public Chickens(Client mc) {
		super(mc);
	}
	
	public int id = 409;
	public void main(String args[]) {
		int imAtX[] = new int[5];
		int imAtY[] = new int[5];
		int imAtC = 0;
		try {
			id = Integer.parseInt(getInput("Please enter an NPC ID to attack"));
		} catch (Exception e) { id = 409; }
		while(running()) {
			while (paused()) {
				wait(1000);
			}
			while(sleeping())
				wait(500);
			int index = getNPCIndex(id)[0];
			if(!inCombat(ourPlayer()) && !sleeping() && fatigue() < 80L) {
				attackNPC(index);
				wait(200, 800);
			}
			//if (myPos()[1] < 657 && id == 409) { walkToWait(650,665); }
			if(fatigue() == 80L) {
				doSleep();
			}
			wait(200, 800);
		}
	}
	
	public boolean onKeyPress(int key) {
		if (key == 1012) {
			stop();
		}
		else if (key == 1011) {
			id = Integer.parseInt(getInput("Re-Enter ID of NPC to attack"));
		}
		else {
			return false;
		}
		return true;
	}
	public void onStop() {
		printMessage("@or2@Stopped");
	}
}
