import bot.*;

public class CustomThiever extends Methods {

	public CustomThiever (Client mc) {
		super(mc);
		//this.mc=mc;
	}
	private int id = -1;
	public void main(String args[]) {
		printMessage("Started NPC Thiever");
		id = Integer.parseInt(getInput("Enter ID of NPC to thieve"));
		int x = myPos()[0];
		int y = myPos()[1];
		while (running()) {
			while (paused()) {
				wait(1000);
			}
			while (inCombat()) {
				walkTo(x, y);
				wait(421,600);
			}
			while (getCurrHealth() < 18 && !inCombat()) {
				//System.out.println("Health percent: " + getHealthPercent());
				useItem(getItemSlot(373));
				wait(1000,2000);
			}
			if(fatigue() == 100L) {
				doSleep();
			}
			if (getStatBase(6) > 54 && getStatBase(6) < 81) {
				if (getItemSlot(40) > -1) {
					if (getItemSlot(197) > -1) {
						if(getItemSlot(161) > -1) {
							castOnInvItem(28,getItemSlot(161));
							wait(600,800);
						}
					}
				}
			}
			thieveNPC(getNPCIndex(id)[0]);
			wait(220,600);
		}
		
	}
	public boolean onKeyPress(int key) {
		if (key == 1012) {
			stop();
		}
		else if (key == 1011) {
			id = Integer.parseInt(getInput("Re-Enter ID of NPC to thieve"));
		}
		else {
			return false;
		}
		return true;
	}
	public void onStop() {
		printMessage("@or2@Stopped");
	}
	

}
