Posted by Anonymous on Sun 6th Apr 04:27 (modification of post by view diff)
download | new post
- import com.speljohan.rsbot.script.Script;
- import com.speljohan.rsbot.script.wrappers.*;
- public class BarbFlyFisher extends Script {
- private static final RSTile[] FISH_TO_BANK = {
- //From the fishing spot to the bank
- new RSTile(3101, 3434), new RSTile(3099, 3442), new RSTile(3098, 3451),
- new RSTile(3096, 3460), new RSTile(3099, 3470), new RSTile(3099, 3478),
- new RSTile(3099, 3485), new RSTile(3092, 3492) };
- private static final RSTile[] DEATH_ROUTE = {
- new RSTile(3232, 3219), new RSTile(3232, 3227), new RSTile(3226, 3235),
- new RSTile(3220, 3245), new RSTile(3217, 3254), new RSTile(3217, 3264),
- new RSTile(3216, 3274), new RSTile(3208, 3280), new RSTile(3197, 3280),
- new RSTile(3188, 3284), new RSTile(3179, 3287), new RSTile(3167, 3288),
- new RSTile(3166, 3298), new RSTile(3161, 3306), new RSTile(3156, 3312),
- new RSTile(3149, 3318), new RSTile(3143, 3331), new RSTile(3142, 3343),
- new RSTile(3141, 3354), new RSTile(3139, 3364), new RSTile(3135, 3373),
- new RSTile(3129, 3382), new RSTile(3121, 3386), new RSTile(3109, 3393),
- new RSTile(3104, 3405), new RSTile(3101, 3416), new RSTile(3098, 3426),
- new RSTile(3089, 3433), new RSTile(3090, 3445), new RSTile(3090, 3456),
- new RSTile(3096, 3463), new RSTile(3099, 3475), new RSTile(3100, 3485),
- new RSTile(3092, 3493) };
- RSTile[] BANK_TO_FISH = reversePath(FISH_TO_BANK);
- public static final int[] fishingSpots = new int[] { 327, 328 };
- public static final int[] bankBooth = new int[] { 26972 };
- public static final int[] bankMan = new int[] { 5912, 5913 };
- public static final int featherID = 314;
- public static final int flyRodID = 309;
- public static final int[] Fish = new int[] {335, 331};
- public double getVersion() {
- return 1.0;
- }
- return "Barbarian Fly Fisher";
- }
- return "WoW Sucks";
- }
- return true;
- }
- public int loop() {
- if(getMyPlayer().getAnimation() != -1) {
- return random(1000,2000);
- }
- if(getInventoryCount() == 28 || getInventoryCount(featherID) < 1 || getInventoryCount(flyRodID) < 1) {
- walkToBank();
- }
- if(distanceTo(FISH_TO_BANK[0]) < 15 && getInventoryCount(flyRodID) >= 1 && getInventoryCount(featherID) > 1 && getInventoryCount() < 28 ) {
- fish();
- }
- if(getInventoryCount() > 3 && distanceTo(BANK_TO_FISH[0]) < 10) {
- bank();
- }
- if(getInventoryCount(Fish) < 1 && distanceTo(BANK_TO_FISH[0]) < 10 && getInventoryCount(featherID) > 0 && getInventoryCount(flyRodID) >= 1) {
- walkToFish();
- }
- return(1000);
- }
- public boolean atBank() {
- RSObject booth = findObject(bankBooth);
- if(distanceTo(booth) < 15 && getInventoryCount() > 3) {
- return true;
- }
- return false;
- }
- public void bank() {
- RSObject booth = findObject(bankBooth);
- if(booth != null) {
- atObject(booth, "Use-quickly");
- wait(random(1000,2000));
- depositAllExcept(featherID, flyRodID);
- wait(random(1000,2000));
- closeBank();
- } else {
- RSNPC Man = getNearestNPCByID(bankMan);
- atNPC(Man, "Use-quickly");
- wait(random(1000,2000));
- depositAllExcept(featherID, flyRodID);
- wait(random(1000,1500));
- closeBank();
- }
- }
- public void walkToFish() {
- setRun(true);
- while(getInventoryCount(Fish) == 0 && distanceTo(FISH_TO_BANK[0]) > 1) {
- if(getMyPlayer().isMoving()) wait(random(1000,2000));
- walkPathMM(randomizePath(BANK_TO_FISH, 1, 1), 18);
- }
- }
- public void doDeathRoute() {
- setRun(true);
- while(distanceTo(DEATH_ROUTE[DEATH_ROUTE.length -1]) > 5 && getInventoryCount() < 10 ) {
- if(getMyPlayer().isMoving()) wait(random(1000,2000));
- walkPathMM(randomizePath(DEATH_ROUTE, 1, 1), 20);
- }
- }
- public void walkToBank() {
- setRun(true);
- while(distanceTo(FISH_TO_BANK[FISH_TO_BANK.length -1]) > 5) {
- if(getMyPlayer().isMoving()) wait(random(1000,2000));
- walkPathMM(randomizePath(FISH_TO_BANK, 1, 1), 20);
- }
- }
- public void fish() {
- RSNPC spot = getNearestNPCByID(fishingSpots);
- atNPC(spot, "Lure");
- }
- }
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.