pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

Advertising: Loans - Mobile Phones - Cheap Flights - Scottsdale Landscaping
Java paste-bin - collaborative debugging tool View Help

Posted by Anonymous on Sun 6th Apr 04:27 (modification of post by view diff)
download | new post

  1. import com.speljohan.rsbot.script.Script;
  2. import com.speljohan.rsbot.script.wrappers.*;
  3.  
  4. public class BarbFlyFisher extends Script {
  5.        
  6.         private static final RSTile[] FISH_TO_BANK = {
  7.         //From the fishing spot to the bank
  8.         new RSTile(3101, 3434), new RSTile(3099, 3442), new RSTile(3098, 3451),
  9.         new RSTile(3096, 3460), new RSTile(3099, 3470), new RSTile(3099, 3478),
  10.         new RSTile(3099, 3485), new RSTile(3092, 3492) };
  11.                
  12.         private static final RSTile[] DEATH_ROUTE = {
  13.                
  14.         new RSTile(3232, 3219), new RSTile(3232, 3227), new RSTile(3226, 3235),
  15.         new RSTile(3220, 3245), new RSTile(3217, 3254), new RSTile(3217, 3264),
  16.         new RSTile(3216, 3274), new RSTile(3208, 3280), new RSTile(3197, 3280),
  17.         new RSTile(3188, 3284), new RSTile(3179, 3287), new RSTile(3167, 3288),
  18.         new RSTile(3166, 3298), new RSTile(3161, 3306), new RSTile(3156, 3312),
  19.         new RSTile(3149, 3318), new RSTile(3143, 3331), new RSTile(3142, 3343),
  20.         new RSTile(3141, 3354), new RSTile(3139, 3364), new RSTile(3135, 3373),
  21.         new RSTile(3129, 3382), new RSTile(3121, 3386), new RSTile(3109, 3393),
  22.         new RSTile(3104, 3405), new RSTile(3101, 3416), new RSTile(3098, 3426),
  23.         new RSTile(3089, 3433), new RSTile(3090, 3445), new RSTile(3090, 3456),
  24.         new RSTile(3096, 3463), new RSTile(3099, 3475), new RSTile(3100, 3485),
  25.         new RSTile(3092, 3493) };              
  26.                
  27.         RSTile[] BANK_TO_FISH = reversePath(FISH_TO_BANK);
  28.        
  29.         public static final int[] fishingSpots = new int[] { 327, 328 };
  30.         public static final int[] bankBooth = new int[] { 26972 };
  31.         public static final int[] bankMan = new int[] { 5912, 5913 };
  32.         public static final int featherID = 314;
  33.         public static final int flyRodID = 309;
  34.         public static final int[] Fish = new int[] {335, 331};
  35.  
  36.     public double getVersion() {
  37.         return 1.0;
  38.     }
  39.  
  40.     public String getName() {
  41.         return "Barbarian Fly Fisher";
  42.     }
  43.  
  44.     public String getAuthor() {
  45.         return "WoW Sucks";
  46.     }
  47.  
  48.     public boolean onStart(String[] args) {
  49.        
  50.     return true;
  51.     }
  52.     public int loop() {
  53.  
  54.         if(getMyPlayer().getAnimation() != -1) {
  55.                 return random(1000,2000);
  56.         }
  57.        
  58.     if(getInventoryCount() == 28 || getInventoryCount(featherID) < 1 || getInventoryCount(flyRodID) < 1) {
  59.         walkToBank();
  60.     }
  61.    
  62.     if(distanceTo(FISH_TO_BANK[0]) < 15 && getInventoryCount(flyRodID) >= 1 && getInventoryCount(featherID) > 1 && getInventoryCount() < 28 ) { 
  63.         fish();
  64.              }
  65.                       
  66.         if(getInventoryCount() > 3 && distanceTo(BANK_TO_FISH[0]) < 10) {
  67.              bank();
  68.         }
  69.         
  70.         if(getInventoryCount(Fish) < 1 && distanceTo(BANK_TO_FISH[0]) < 10 && getInventoryCount(featherID) > 0 && getInventoryCount(flyRodID) >= 1) {        
  71.              walkToFish();             
  72.         }   
  73.              return(1000);
  74.              
  75.     }
  76.  
  77.     public boolean atBank() {
  78.         RSObject booth = findObject(bankBooth);
  79.     if(distanceTo(booth) < 15 && getInventoryCount() > 3) {
  80.                 return true;
  81.          }
  82.          return false;
  83.    }
  84.        
  85.    
  86.     public void bank() {
  87.    
  88.     RSObject booth = findObject(bankBooth);
  89.         if(booth != null) {
  90.                 atObject(booth, "Use-quickly");
  91.                 wait(random(1000,2000));
  92.                 depositAllExcept(featherID, flyRodID);
  93.                 wait(random(1000,2000));
  94.                 closeBank();
  95.                 } else {
  96.                                
  97.                 RSNPC Man = getNearestNPCByID(bankMan);
  98.                 atNPC(Man, "Use-quickly");
  99.                 wait(random(1000,2000));
  100.                 depositAllExcept(featherID, flyRodID);
  101.                 wait(random(1000,1500));
  102.                 closeBank();
  103.                 }
  104.         }
  105.  
  106.  public void walkToFish() {
  107.         setRun(true);
  108.         while(getInventoryCount(Fish) == 0 && distanceTo(FISH_TO_BANK[0]) > 1) {
  109.                if(getMyPlayer().isMoving()) wait(random(1000,2000));
  110.                 walkPathMM(randomizePath(BANK_TO_FISH, 1, 1), 18);
  111.         }
  112.  }
  113.  
  114.  public void doDeathRoute() {
  115.         setRun(true);
  116.     while(distanceTo(DEATH_ROUTE[DEATH_ROUTE.length -1]) > 5 && getInventoryCount() < 10 ) {
  117.         if(getMyPlayer().isMoving()) wait(random(1000,2000));
  118.                 walkPathMM(randomizePath(DEATH_ROUTE, 1, 1), 20);
  119.                
  120.         }
  121.  }
  122.        
  123.        
  124.  public void walkToBank() {
  125.         setRun(true);
  126.                 while(distanceTo(FISH_TO_BANK[FISH_TO_BANK.length -1]) > 5) {
  127.                         if(getMyPlayer().isMoving()) wait(random(1000,2000));
  128.                         walkPathMM(randomizePath(FISH_TO_BANK, 1, 1), 20);
  129.                 }
  130.         }
  131.        
  132.  public void fish() {
  133.         RSNPC spot = getNearestNPCByID(fishingSpots);
  134.                 atNPC(spot, "Lure");   
  135.                 }
  136.         }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me
: