Advertisement
Guest User

Untitled

a guest
Oct 14th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.72 KB | None | 0 0
  1. @ScriptManifest(name = "WetsCowKiller", author = "anigaVteW", version = 1.2, info="Kills Cows Till Your Wet")
  2.  
  3.         public class cowkiller extends Script {
  4.                
  5. private State state;
  6.  
  7.                 private Area cowArea;
  8.                 private String cowhide = "Cow Hide";
  9.                 final String COW_NAME = "Cow";
  10.                
  11.                
  12.        
  13.         public enum State
  14.         {
  15.                 KILL,BANK,PICKUP,DEPOSIT
  16.         }
  17.          
  18.        
  19.        
  20.         public void onStart() {
  21.  
  22. this.state = State.KILL;
  23.  
  24.        
  25.        
  26.         }
  27.        
  28.         public int pickUp() throws InterruptedException
  29.         {
  30.                 GroundItem cowhide = this.closestGroundItemForName(cowArea, this.cowhide);
  31.                 if(cowhide != null)
  32.                 {
  33.                         this.walk(cowhide);
  34.                         sleep(1000);
  35.                         cowhide.interact("Pick up");
  36.                                 sleep(400);
  37.                 }
  38.                 return 250;
  39.         }
  40.                        
  41.         public int bank() throws InterruptedException
  42.         {
  43.                 RS2Object bankBooth =  closestObjectForName("bank booth");
  44.                 if(bankBooth != null)
  45.                 {
  46.                         if (!client.getBank().isOpen()) {
  47.                                 if (bankBooth!=null){
  48.                                         for(int i = 0; i < 10 && !bankBooth.interact("Bank"); i++){
  49.                                                 sleep(random(500,600));
  50.                                         }
  51.                                 }
  52.                         }
  53.                 }
  54.                 for(int i = 0; i < 4 && !client.getBank().isOpen(); i++){
  55.                         sleep(random(500,600));
  56.                 }
  57.                 return 250;
  58.         }
  59.        
  60.        
  61.         public int kill() throws InterruptedException
  62.         {
  63.                 NPC cow = closestNPCForName("Cow");//.interact("Attack");
  64.                         if (client.getMyPlayer().getFacing() == null ){
  65.                         cow.interact("Attack");
  66.                                 sleep(random(500,1000));
  67.                         }
  68.                         return 250;
  69.         }
  70.        
  71.         private int deposit() throws InterruptedException {
  72.                 RS2Object bankBooth = this.closestObjectForName("bank booth");
  73.                 if (!client.getBank().isOpen()) {
  74.                         if (bankBooth!=null)    {
  75.                                 if (bankBooth.isVisible())      {
  76.                                         bankBooth.interact("bank");
  77.                                         sleep(1000);
  78.                                 }else{
  79.                                         client.moveCameraToEntity(bankBooth);
  80.                                         sleep(1000);
  81.                                 }
  82.                         }
  83.                 }else{
  84.                         if (!client.getInventory().isEmpty())   {
  85.                                 client.getBank().depositAll();
  86.                                 sleep(2000);
  87.                 }
  88.                
  89.                 return random(1000,2000);
  90.         }
  91.                 return 0;
  92. }
  93.         public int onLoop() throws InterruptedException
  94.         {
  95.                
  96.                
  97. if (this.state == State.KILL) {
  98.                         return kill();
  99.                 } else if (this.state == State.BANK) {
  100.                         return bank();
  101.                 } else if (this.state == State.PICKUP) {
  102.                         return pickUp();
  103.                 } else if (this.state == State.DEPOSIT) {
  104.                         return deposit();
  105.                 }
  106.  
  107.                 return 250 + random(50);
  108.  
  109.         }
  110.        
  111.        
  112.        
  113.        
  114.        
  115.        
  116.         /*public void onMessage(String message) throws InterruptedException     {
  117.             if (message.equalsIgnoreCase("You caught a")) {
  118.                         cow ++;
  119.                         }
  120.         }
  121.        
  122.         /*public void onPaint(Graphics g)
  123.         {
  124.                 g = (Graphics2D)g;
  125.                 g.drawImage(back, 4, 345, null);
  126.                   String runtime = format(System.currentTimeMillis() - this.starttime);
  127.                  g.setColor(Color.GREEN);
  128.                  g.drawString(" " +state, 210, 463);
  129.                  g.drawString(" " +runtime, 210, 398);
  130.                  g.drawString(" " +client.getSkills().getLevel(Skill.HUNTER), 210, 412);
  131.                  g.drawString(" " +(client.getSkills().getExperience(Skill.HUNTER)), 210, 429);
  132.                  g.drawString(" " +lizard, 210, 447);
  133.         }
  134.         */
  135.         public void onExit()
  136.         {
  137.                
  138.         }
  139.        
  140.        
  141.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement