Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ScriptManifest(name = "WetsCowKiller", author = "anigaVteW", version = 1.2, info="Kills Cows Till Your Wet")
- public class cowkiller extends Script {
- private State state;
- private Area cowArea;
- private String cowhide = "Cow Hide";
- final String COW_NAME = "Cow";
- public enum State
- {
- KILL,BANK,PICKUP,DEPOSIT
- }
- public void onStart() {
- this.state = State.KILL;
- }
- public int pickUp() throws InterruptedException
- {
- GroundItem cowhide = this.closestGroundItemForName(cowArea, this.cowhide);
- if(cowhide != null)
- {
- this.walk(cowhide);
- sleep(1000);
- cowhide.interact("Pick up");
- sleep(400);
- }
- return 250;
- }
- public int bank() throws InterruptedException
- {
- RS2Object bankBooth = closestObjectForName("bank booth");
- if(bankBooth != null)
- {
- if (!client.getBank().isOpen()) {
- if (bankBooth!=null){
- for(int i = 0; i < 10 && !bankBooth.interact("Bank"); i++){
- sleep(random(500,600));
- }
- }
- }
- }
- for(int i = 0; i < 4 && !client.getBank().isOpen(); i++){
- sleep(random(500,600));
- }
- return 250;
- }
- public int kill() throws InterruptedException
- {
- NPC cow = closestNPCForName("Cow");//.interact("Attack");
- if (client.getMyPlayer().getFacing() == null ){
- cow.interact("Attack");
- sleep(random(500,1000));
- }
- return 250;
- }
- private int deposit() throws InterruptedException {
- RS2Object bankBooth = this.closestObjectForName("bank booth");
- if (!client.getBank().isOpen()) {
- if (bankBooth!=null) {
- if (bankBooth.isVisible()) {
- bankBooth.interact("bank");
- sleep(1000);
- }else{
- client.moveCameraToEntity(bankBooth);
- sleep(1000);
- }
- }
- }else{
- if (!client.getInventory().isEmpty()) {
- client.getBank().depositAll();
- sleep(2000);
- }
- return random(1000,2000);
- }
- return 0;
- }
- public int onLoop() throws InterruptedException
- {
- if (this.state == State.KILL) {
- return kill();
- } else if (this.state == State.BANK) {
- return bank();
- } else if (this.state == State.PICKUP) {
- return pickUp();
- } else if (this.state == State.DEPOSIT) {
- return deposit();
- }
- return 250 + random(50);
- }
- /*public void onMessage(String message) throws InterruptedException {
- if (message.equalsIgnoreCase("You caught a")) {
- cow ++;
- }
- }
- /*public void onPaint(Graphics g)
- {
- g = (Graphics2D)g;
- g.drawImage(back, 4, 345, null);
- String runtime = format(System.currentTimeMillis() - this.starttime);
- g.setColor(Color.GREEN);
- g.drawString(" " +state, 210, 463);
- g.drawString(" " +runtime, 210, 398);
- g.drawString(" " +client.getSkills().getLevel(Skill.HUNTER), 210, 412);
- g.drawString(" " +(client.getSkills().getExperience(Skill.HUNTER)), 210, 429);
- g.drawString(" " +lizard, 210, 447);
- }
- */
- public void onExit()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement