Improve your writing

RuneScape Fisher for 1.9x Api

This is a fisher for Draynor Village.

this is a little script i made you must have RSbot 1.9x api to use

please Copy and save the Code below file in “RSBot/Scripts/Sources”
Save as “Fisher.java”

“Code”
.util.Map;
import java.util.Random;
import java.awt.*;
import java.awt.Graphics;

import org.rsbot.event.events.ServerMessageEvent;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.event.listeners.ServerMessageListener;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSNPC;
import org.rsbot.script.wrappers.RSArea;
import org.rsbot.script.wrappers.RSTile;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Interfaces;
import org.rsbot.script.methods.Skills;

@ScriptManifest(authors = {”CK”}, keywords = “Fishing”, name = “Draynor Fisher”, version = 2.2,
description = (”Draynor Fisher with AntiBan”))
             
public class Fisher extends Script implements PaintListener, ServerMessageListener {

public long startTime = System.currentTimeMillis();
public int startexp;

private String status = “”;

public int fishSpotID = 327;
public int rawShrimpID = 317;
public int rawAnchoviesID = 321;
public int fishNetID = 303;
public int boothID = 2213;

RSArea fishArea = new RSArea(new RSTile(3080, 3227), new RSTile(3090, 3235));
RSArea bankArea = new RSArea(new RSTile(3092, 3240), new RSTile(3097, 3246));
   
RSTile[] toBank = {new RSTile (3087, 3240), new RSTile(3094, 3243)};
RSTile[] toFish = {new RSTile (3087, 3240), new RSTile(3086, 3230)};

    public boolean onStart() {
        log(”welcome to Draynor Fisher”);
        startTime = System.currentTimeMillis();
        return true;
    }
   
    private boolean atFish(){
        return fishArea.contains(getMyPlayer().getLocation());
    }
    private boolean atBank(){
        return bankArea.contains(getMyPlayer().getLocation());
    }
   
    public boolean randomToBank(){status=”Heading to Bank”;
        RSTile[] randomizedPath = walking.randomizePath(toBank, 3, 3);
        return walking.walkPathMM(randomizedPath, 10);
       
    }
   
    public boolean randomToFish(){status=”Heading to Fishing spot”;
        RSTile[] randomizedPath = walking.randomizePath(toFish, 3, 3);
        return walking.walkPathMM(randomizedPath, 10);
       
    }
   
public int fish(){
    RSNPC Fishpool = npcs.getNearest(fishSpotID);
    if(getMyPlayer().getAnimation() == -1 && Fishpool != null ){
    status=”Fishing At Spot”;
   
    Fishpool.doAction(”Net”);
    } return 1000;
}
public void useBank(){
    RSObject booth = objects.getNearest(boothID);
        if(!bank.isOpen()){
            status=”Using Bank”;
            booth.doAction(”Use-Quickly”);
            sleep (random(1500, 2500));
        } else if(bank.isOpen()){
            bank.deposit(rawAnchoviesID,0);
            bank.deposit(rawShrimpID,0);
            bank.depositAllExcept(fishNetID);
            status=”Closing Bank”;
            bank.close();
        }
    }
private AntiBan antiban;
 class antiBan extends Thread{
     private Fisher parent;
     private Random randomGenerator;
     private int[] tabs = {Game.TAB_ATTACK, Game.TAB_CLAN, Game.TAB_EQUIPMENT, Game.TAB_MAGIC};
     
     AntiBan(Fisher parent){
         this.parent = parent;
         this.randomGenerator = new Random();
     }

@Override     
 public void run(){
                  while(parent.isActive()) {
                 if(!parent.isPaused()) {
                     int rand = randomGenerator.nextInt(6);
                     
                     switch(rand){
                     case 0:
                         parent.game.openTab(Game.TAB_ATTACK);
                         log(”Opening Attack tab”);
                         break;
                     case 1:
                         parent.mouse.moveSlightly();
                         parent.game.openTab(Game.TAB_STATS);
                         log(”checking Stats”);
                         break;                                          
                                         }
                 }
             }
         }
     
     
 }
   
    public int loop() {
        if(atFish() && !inventory.isFull()){
            fish();
    }else if(inventory.isFull() && !atBank()){
        randomToBank();
    }else if(!atFish() && !inventory.isFull()){
        randomToFish();
    }else if(atBank() && inventory.isFull()){
        useBank();
    } return (random(1000, 2500));
}

   

    public void onFinish() {
        log(”Goodbye I hope it worked well”);
       
    }

    //Paint Details

         
    @Override
    public void onRepaint(Graphics g1) {
        Graphics2D g = (Graphics2D)g1;
        if(game.isLoggedIn()){
            int xpGained = 0;
            if ( startexp == 0) {
                 startexp = skills.getCurrentExp(Skills.FISHING);
            }
            xpGained = skills.getCurrentExp(Skills.FISHING) – startexp;
           
            final int percent = skills.getPercentToNextLevel(Skills.FISHING); //change the MINING to the stat u want
            g.drawString(”Percent till next level: “, 3, 320);
            g.setColor(Color.red);
            g.fillRoundRect(120, 310, 100, 10, 15, 15); //these must be on same cordinates
            g.setColor(Color.green);
            g.fillRoundRect(120, 310, percent, 10, 15, 15); //these must be on same cordinates
            g.setColor(Color.black);
            g.drawString(”" + percent, 170, 320); //this must be on the center of the bar
            g.drawRoundRect(120, 310, 100, 10, 15, 15); //these must be on same cordinates
            g.drawRoundRect(120, 310, percent, 10, 15, 15); //these must be on same cordinates
           
            long millis = System.currentTimeMillis() – startTime;
            long hours = millis / (1000 * 60 * 60);
            millis -= hours * (1000 * 60 * 60);
            long minutes = millis / (1000 * 60);
            millis -= minutes * (1000 * 60);
            long seconds = millis / 1000;
            long minutes2 = minutes + (hours * 60);
            g.setColor(Color.red);
            g.drawString(”Time running: ” + hours + “:” + minutes + “:” + seconds + “.”, 3, 337);
            g.drawString(”Status:”+status, 3, 264);
            g.drawString(”XP Gained:”+xpGained, 3, 300);
           
            }
    }

    @Override
    public void serverMessageRecieved(ServerMessageEvent e) {    
    }
}
“Code End”

0
Liked it

Tags: , , ,

One Response to “RuneScape Fisher for 1.9x Api”
Leave a Reply
Click the icon to the left to subscribe to Writinghood with your favorite RSS reader.
© 2009 Writinghood | About | Advertise | Contact | Submit an Article
Powered by