blahs44

Untitled

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