Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 2.80 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import org.rsbot.script.Script;
  2.         import org.rsbot.script.ScriptManifest;
  3.         import java.awt.Point;
  4.         import org.rsbot.script.wrappers.RSArea;
  5.         import org.rsbot.script.wrappers.RSNPC;
  6.         import org.rsbot.script.wrappers.RSObject;
  7.         import org.rsbot.script.wrappers.RSTile;
  8.        
  9.        
  10.         @ScriptManifest(authors = "DeadlyOreo", name = "OreoFisher", version = 1.0, description = "Guild Fisher")
  11.         public class OreoFisher extends Script {
  12.        
  13.         private int spotID=312;
  14.         private int lobID=377;
  15.         private int bankBoothID = 49018;
  16.  
  17.         RSTile[] toBank = { new RSTile(2598, 3420), new RSTile(2593, 3420), new RSTile(2588, 3422), new RSTile(2585, 3422) };
  18.         RSTile[] toFish = walking.reversePath(toBank);
  19.         RSTile fishTile = new RSTile(2598, 3420);
  20.         RSTile bankTile = new RSTile(2585, 3422);
  21.                
  22.                
  23.         public boolean onStart(){
  24.                 log("Welcome to Oreo Fisher!");
  25.         return true;
  26.         }
  27.        
  28.         public void catchFish(){
  29.                 RSNPC fish = npcs.getNearest(spotID);
  30.                 if (fish != null && fish.isOnScreen() == true && getMyPlayer().getAnimation() == -1){
  31.                         Point m = calc.tileToScreen(fish.getLocation());
  32.                         mouse.move(m);
  33.                         mouse.click(false);
  34.                         sleep(500,1000);
  35.                         menu.doAction("age");
  36.                 }
  37.         }
  38.        
  39.         private boolean walkToBankFromSpots() {
  40.         RSTile[] randomizedPath = walking.randomizePath(toBank, 2, 2);
  41.         return walking.walkPathMM(randomizedPath, 15);
  42.     }
  43.        
  44.        
  45.         private boolean atBank(){
  46.                 RSArea area = new RSArea(new RSTile(2585, 3420), new RSTile(2587, 3423));
  47.                 return area.contains(getMyPlayer().getLocation());
  48.                 }
  49.  
  50.        
  51.        
  52.         private void bank(){
  53.                 openBank();
  54.                 depositFish();
  55.                 closeBank();
  56.                 }
  57.        
  58.         private boolean walkToSpotsFromBank() {
  59.         RSTile[] randomizedPath = walking.randomizePath(toFish, 2, 2);
  60.         return walking.walkPathMM(randomizedPath, 15);
  61.     }
  62.        
  63.         private boolean atFishingSpots(){
  64.                 RSArea area = new RSArea(new RSTile(2006, 3425), new RSTile(2611, 3412));
  65.                 return area.contains(getMyPlayer().getLocation());
  66.                 }
  67.  
  68.        
  69.         private void openBank(){
  70.                 RSObject Booth = objects.getNearest(bankBoothID);
  71.                 if (Booth != null && !bank.isOpen()) {
  72.                         Booth.doAction("uickly");
  73.                 }
  74.  
  75.                 }
  76.        
  77.         private void depositFish(){
  78.                 if (bank.isOpen()) {
  79.                         bank.deposit(lobID, 0);
  80.                         sleep(200, 500);
  81.                 }
  82.         }
  83.        
  84.        
  85.         private void closeBank() {
  86.                 if(bank.isOpen()){
  87.                 mouse.move(490, 36, 3, 3);
  88.                 sleep(200, 500);
  89.                 mouse.click(true);
  90.                 }
  91.         }
  92.  
  93.  
  94.         public void onFinish(){
  95.                 log("Thank you for using Oreo Fisher!");
  96.         }
  97.        
  98.        
  99.                 @Override
  100.                 public int loop() {
  101.  
  102.                        
  103.                          if (atFishingSpots() && inventory.isFull()) {
  104.                                 walkToBankFromSpots();
  105.                         } else if (atBank() && inventory.isFull()){
  106.                                 bank();
  107.                         } else if (atFishingSpots() && !inventory.isFull()) {
  108.                                 catchFish();
  109.                         } else if (atBank() && !inventory.isFull()){
  110.                                 walkToSpotsFromBank();
  111.                         }
  112.                         return (random(650, 950));
  113.                 }
  114.         }