ULTIMATE GUIDE

LoG iN

Join the forum, it's quick and easy

ULTIMATE GUIDE

LoG iN

ULTIMATE GUIDE

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ULTIMATE GUIDE


    QckKaramjaFisher

    avatar
    Turk4life321
    Admin


    Posts : 41
    Join date : 2009-08-09
    Location : In Saims Room *cough*

    QckKaramjaFisher Empty QckKaramjaFisher

    Post  Turk4life321 Fri Jan 01, 2010 4:47 am

    import java.io.*;
    import java.net.*;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.Polygon;
    import java.awt.event.KeyEvent;
    import java.lang.reflect.Method;
    import java.util.Map;
    import java.util.Random;

    import javax.swing.JOptionPane;
    import org.rsbot.bot.Bot;
    import org.rsbot.script.GEItemInfo;
    import org.rsbot.script.ScriptManifest;
    import org.rsbot.event.events.ServerMessageEvent;
    import org.rsbot.event.listeners.PaintListener;
    import org.rsbot.event.listeners.ServerMessageListener;
    import org.rsbot.script.wrappers.RSInterface;
    import org.rsbot.script.wrappers.RSNPC;
    import org.rsbot.script.wrappers.RSObject;
    import org.rsbot.script.wrappers.RSTile;
    import org.rsbot.script.Script;

    //Credits
    // Antiban structure based off Garrett's antiban, however the actions are all my own.
    // Multi-threaded anti-ban (QckKaramjaFisherAntiBan class) courtesy of Taha's tutorial. (http://itaha.com/?p=96)
    // Paint progress bar courtesy of purefocus (http://www.rsbot.org/vb/showthread.php?p=2089956)

    @ScriptManifest(authors = { "Qckdrw777" }, category = "Fishing", name = "QckKaramjaFisher", version = 2.07, description = "<html><head>"
    + "</head><body>"
    + "<center>"
    + "<b><font size=\"5\" color=\"Black\">"
    + "QckKaramjaFisher"
    + " V2.07"
    + "</font></b>"
    + "<br></br>"
    + "<i><font size=\"4\" color=\"black\">Karamja Fisher Extraordinaire </i>"
    + "<br></br>"
    + "<br></br>"
    + "Start in the draynor bank or at the Karamja fishing spot if you are banking."
    + "Start at the Karamja fishing spot if you are selling."
    + "<br></br>"
    + "Select Which Fish To Catch:"
    + "<br><select name='FISH'><option>Lobster<option>Swordfish</select>"
    + "<br></br>"
    + "Bank or Sell Fish?"
    + "<br><select name='BANK'><option>Bank<option>Sell</select>"
    + "<br><input name='CABBAGETELE' type='checkbox' value='1'>Use Explorer's Ring 3 Teleport"
    + "<br><input name='DROPTUNA' type='checkbox' value='1'>Drop Tuna"
    + "<br></br>"
    + "<br><center>NOTES:</center></br>"
    + "-If you are planning on banking, you must have done the Pirate's Treasure quest."
    + "<br></br>"
    + "-This script automatically connects to the internet and checks for updates."
    + "</body></html>"
    )

    public class QckKaramjaFisher extends Script implements PaintListener, ServerMessageListener {

    public int [] shopKeeper = {533, 532};
    public int fishingSpotID = 324;
    public int lobsterPot = 301;
    public int lobster = 377;
    public int coins = 995;
    public int harpoon = 311;
    public int tuna = 359;
    public int swordfish = 371;
    public int bankBooth = 2213;
    public int customsOfficer = 380;
    public int [] sailors = {377, 376, 378};
    public int portSarimPlank = 2084;
    public int karamjaPlank = 2082;
    public int explorersRing3 = 13562;
    public int gate = 7050;
    public int moneymade;
    public int startexp;
    public int fishCaught;
    public int tunaCaught;
    public int lobsterCaught;
    public int swordfishCaught;
    public int tunaValue;
    public int lobsterValue;
    public int swordfishValue;
    public int moneyMade;
    public int levelsGained;
    public int fishPerHour;
    public int xpPerHour;
    public int percentToNextLevel;
    int xpGained = 0;
    public long startTime = System.currentTimeMillis();
    private String status = "";
    public String FISHACTION;
    public String BANKACTION;
    private boolean dropTuna = false;
    private boolean cabbageTele = false;
    private boolean equiptmentCheck = false;
    private boolean ringCheck = false;
    RSTile sellTile = new RSTile(2904, 3150);
    RSTile fishingSpotTile = new RSTile(2924, 3178);
    RSTile karamjaDockTile = new RSTile(2954, 3148);
    RSTile portSarimDockTile = new RSTile(3027, 3218);
    RSTile draynorBankTile = new RSTile(3092, 3243);
    RSTile portSarimShipTile = new RSTile(3032, 3217);
    RSTile karamjaShipTile = new RSTile (2956, 3143);
    RSTile gateTile = new RSTile (3053, 3284);
    RSTile[] toBank = {new RSTile(3028, 3216), new RSTile(3027, 3224), new RSTile(3029, 3225), new RSTile(3028, 3232), new RSTile(3036, 3235), new RSTile(3042, 3236), new RSTile(3041, 3242), new RSTile(3048, 3245), new RSTile(3060, 3252), new RSTile(3059, 3263), new RSTile(3062, 3272), new RSTile(3068, 3275), new RSTile(3074, 3269), new RSTile(3072, 3259), new RSTile(3081, 3249), new RSTile(3092, 3244)};
    RSTile[] fromBank = reversePath(toBank);
    RSTile[]spotToKaramjaDock = {new RSTile(2924, 3178), new RSTile(2920, 3170), new RSTile(2916, 3163), new RSTile(2922, 3151), new RSTile(2933, 3148), new RSTile(2945, 3147), new RSTile(2954, 3148)};
    RSTile[]dockToSpot = reversePath(spotToKaramjaDock);
    RSTile[]spotToShop = {new RSTile(2924, 3177), new RSTile(2922, 3169), new RSTile(2917, 3161), new RSTile(2912, 3151), new RSTile(2904, 3149)};
    RSTile[]shopToSpot = reversePath(spotToShop);
    QckKaramjaFisherAntiBan antiban;
    Thread t;

    private final int[] SHOP_AREA = {2907, 3152, 2901, 3144};
    private final int[] FISHING_DOCK_AREA = {2927, 3180, 2920, 3174};
    private final int[] KARAMJA_DOCK_AREA = {2959, 3151, 2949, 3146};
    private final int[] PORT_SARIM_SHIP_AREA = {3036, 3224, 3032, 3212};
    private final int[] PORT_SARIM_DOCK_AREA = {3030, 3220, 3024, 3214};
    private final int[] DRAYNOR_BANK_AREA = {3095, 3246, 3091, 3241};
    private final int[] KARAMJA_SHIP_AREA = {2963, 3143, 2951, 3139};
    private final int[] CABBAGE_PATCH_AREA = {3060, 3299, 3041, 3283};

    public boolean onStart(Map<String, String> args) {
    startTime = System.currentTimeMillis();
    log("QckKaramjaFisher Started");

    URLConnection url = null;
    BufferedReader in = null;
    try{
    //Open the version text file
    url = new URL("http://www.qckdrw777.webs.com/Scripts/QckKaramjaFisherVERSION.txt").openConnection();
    //Create an input stream for it
    in = new BufferedReader(new InputStreamReader(url.getInputStream()));
    //Check if the current version is outdated
    if(Double.parseDouble(in.readLine()) > getVersion()) {
    //If it is, check if the user would like to update.
    if(JOptionPane.showConfirmDialog(null, "Update found. Do you want to update?") == 0){
    openURL("http://www.qckdrw777.webs.com/qckkaramjafisher.htm");
    }
    }
    }
    catch (final Exception e) {
    e.printStackTrace();
    }


    String FISH = args.get("FISH");
    if (FISH.equals("Lobster")){
    FISHACTION = "Cage";
    log("Fishing For Lobsters");
    }

    if (FISH.equals("Swordfish")){
    FISHACTION = "Harpoon";
    log("Fishing For Swordfish");
    }

    String BANK = args.get("BANK");
    if (BANK.equals("Bank")){
    BANKACTION = "BANK";
    log("Banking Fish");
    }
    if (BANK.equals("Sell")){
    BANKACTION = "SELL";
    log("Selling Fish");
    }

    dropTuna = args.get("DROPTUNA") != null ? true : false;
    cabbageTele = args.get("CABBAGETELE") != null ? true : false;

    log("Parsing GE Item Information");
    final GEItemInfo Lobster = grandExchange.loadItemInfo(lobster);
    lobsterValue = Lobster.getMarketPrice();

    final GEItemInfo Swordfish = grandExchange.loadItemInfo(swordfish);
    swordfishValue = Swordfish.getMarketPrice();

    final GEItemInfo Tuna = grandExchange.loadItemInfo(tuna);
    tunaValue = Tuna.getMarketPrice();
    log("Done");

    antiban = new QckKaramjaFisherAntiBan();
    t = new Thread(antiban);
    return true;
    }

    public void onFinish(){
    Bot.getEventManager().removeListener(PaintListener.class, this);
    Bot.getEventManager().removeListener(ServerMessageListener.class, this);
    antiban.stopThread = true;
    log("QckKaramjaFisher Stopped");
    log("Thanks for using");
    return;
    }

    @Override
    public int getMouseSpeed() {
    return random(8, 10);
    }

    public double getVersion() {
    return (2.07);
    }

    public void serverMessageRecieved(final ServerMessageEvent e) {
    final String word = e.getMessage().toLowerCase();
    if (word.contains("you catch a")) {
    fishCaught++;
    }
    if (word.contains("you catch a tuna")) {
    tunaCaught++;
    }
    if (word.contains("you catch a lobster")) {
    lobsterCaught++;
    }
    if (word.contains("you catch a swordfish")) {
    swordfishCaught++;
    }
    if (word.contains("just advanced a")) {
    levelsGained++;
    }
    if (word.contains("you do not have enough money for that")) {
    log("Out of Coins! Stopping Script.");
    Bot.getScriptHandler().stopScript();
    }
    }

    public void onRepaint(Graphics render) {
    if (isLoggedIn()) {
    if ( startexp == 0) {
    startexp = skills.getCurrentSkillExp(STAT_FISHING);
    }
    long runTime = 0;
    runTime = System.currentTimeMillis() - startTime;
    if ((runTime / 1000) > 0) {
    fishPerHour = (int) ((3600000.0 / (double) runTime) * fishCaught);
    xpPerHour = (int) ((3600000.0 / (double) runTime) * xpGained);
    }

    xpGained = skills.getCurrentSkillExp(STAT_FISHING) - startexp;
    percentToNextLevel = skills.getPercentToNextLevel(STAT_FISHING);
    if ((dropTuna)){
    moneyMade = (lobsterValue * lobsterCaught) + (swordfishValue * swordfishCaught);
    }else{
    moneyMade = (lobsterValue * lobsterCaught) + (swordfishValue * swordfishCaught) + (tunaValue * tunaCaught);
    }
    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;
    render.setColor(Color.gray);
    render.fill3DRect(0, 0, 155, 160, true);
    render.setColor(Color.white);
    render.drawString("QckKaramjaFisher V" + getVersion(), 5, 15);
    render.drawString("Status : " + status , 5, 30);
    render.drawString("Time Running: " + hours + ":" + minutes + ":" + seconds, 5, 45);
    render.drawString("XP Gained: " + xpGained, 5, 60);
    render.drawString("XP/Hour: " + xpPerHour, 5, 75);
    render.drawString("Levels Gained: " + levelsGained, 5, 90);
    render.drawString("Fish Caught: " + fishCaught, 5, 105);
    render.drawString("Fish/Hour: " + fishPerHour, 5, 120);
    render.drawString("Money Made: " + moneyMade +"gp", 5, 135);
    ProgBar(render, 5, 142, 145, 12, percentToNextLevel, Color.red, Color.green, Color.white);
    }
    }

    private int antiBan() {

    int random = random(1, 24);

    switch (random) {
    case 1:
    if (random(1, 5) == 3)
    {
    int x = (int) getMouseLocation().getX();
    int y = (int) getMouseLocation().getY();
    moveMouse(x + random(-100, 100), y + random(-50, 50));
    return random(100, 350);
    }

    case 2:
    if (random(1, 10) == 5)
    {
    openTab(random(1, 6));
    return(random(1152, 2543));
    }

    case 3:
    if (random(1, 100) == 50)
    {
    openTab(TAB_STATS);
    moveMouse(random(664, 710), random(297, 322));
    return(random(731, 2313));
    }

    case 4:
    if (random(1, 147) == 75)
    {
    openTab(random(0, Cool);
    return random(1000, 3673);
    }

    case 5:
    if (random(1, 10) == 9)
    {
    moveMouseRandomly(77);
    return random(105, 435);
    }

    case 6:
    if (random(1, 15) == 7)
    {
    openTab(random(9, 13));
    return random(993, 5435);
    }
    }
    return random(100, 500);
    }

    public void run() {
    if (getEnergy() > random(60, 100) && getSetting(173) != 1)
    setRun(true);
    }

    public void openURL(final String url) { // Credits to Dave who gave credits
    // to
    // some guy who made this.
    final String osName = System.getProperty("os.name");
    try {
    if (osName.startsWith("Mac OS")) {
    final Class<?> fileMgr = Class
    .forName("com.apple.eio.FileManager");
    final Method openURL = fileMgr.getDeclaredMethod("openURL",
    new Class[] { String.class });
    openURL.invoke(null, new Object[] { url });
    } else if (osName.startsWith("Windows")) {
    Runtime.getRuntime().exec(
    "rundll32 url.dll,FileProtocolHandler " + url);
    } else { // assume Unix or Linux
    final String[] browsers = { "firefox", "opera", "konqueror",
    "epiphany", "mozilla", "netscape" };
    String browser = null;
    for (int count = 0; count < browsers.length && browser == null; count++) {
    if (Runtime.getRuntime().exec(
    new String[] { "which", browsers[count] })
    .waitFor() == 0) {
    browser = browsers[count];
    }
    }
    if (browser == null) {
    throw new Exception("Could not find web browser");
    } else {
    Runtime.getRuntime().exec(new String[] { browser, url });
    }
    }
    } catch (final Exception e) {
    }
    }

    public boolean spotToShop() {
    walkPathMM(randomizePath(spotToShop,2 ,2 ));
    return true;
    }

    public boolean walkToSpot() {
    walkPathMM(randomizePath(shopToSpot,2 ,2 ));
    return true;
    }

    public boolean walkToKaramjaDock() {
    walkPathMM(randomizePath(spotToKaramjaDock,2 ,2 ));
    return true;
    }

    public boolean dockToSpot() {
    walkPathMM(randomizePath(dockToSpot,2 ,2 ));
    return true;
    }

    public boolean walkToBank() {
    walkPathMM(randomizePath(toBank,2 ,2 ));
    return true;
    }

    public boolean walkToPortSarimDock() {
    walkPathMM(randomizePath(fromBank,2 ,2 ));
    return true;
    }

    public boolean playerInArea(int maxX, int maxY, int minX, int minY) {
    int x = getMyPlayer().getLocation().getX();
    int y = getMyPlayer().getLocation().getY();
    if (x >= minX && x <= maxX && y >= minY && y <= maxY)
    return true;
    return false;
    }

    public boolean playerInArea(final int[] area) {
    final int x = getMyPlayer().getLocation().getX();
    final int y = getMyPlayer().getLocation().getY();
    if (x >= area[2] && x <= area[0] && y >= area[3] && y <= area[1])
    return true;
    return false;
    }

    public boolean playerInArea(Polygon area)
    {
    return area.contains(new Point(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY()));
    }

    public boolean sell() {
    RSNPC shopkeeper = getNearestNPCByID(shopKeeper);
    if(shopkeeper != null) {
    if(!tileOnScreen(shopkeeper.getLocation())) {
    turnToTile(shopkeeper.getLocation(), 15);
    }
    atNPC(shopkeeper,"Trade");
    wait(random(3000,4000));
    if(RSInterface.getInterface(620).isValid()) {
    if(inventoryContains(lobster)){
    atInventoryItem(lobster, "Sell 50");
    wait(random(500, 1000));
    }
    if(inventoryContains(swordfish)){
    atInventoryItem(swordfish, "Sell 50");
    wait(random(500, 1000));
    }
    if(inventoryContains(tuna)){
    atInventoryItem(tuna, "Sell 50");
    wait(random(500, 1000));
    }
    atInterface(RSInterface.getInterface(620).getChild(18));
    return true;
    }
    }
    return false;
    }

    public boolean dropTuna() {
    status = "Dropping Tuna";
    dropAllExcept(lobsterPot, harpoon, lobster, swordfish, coins);
    wait(random(100, 200));
    return true;
    }

    public void fish(){
    setCameraAltitude(true);
    RSNPC fishingspot = getNearestNPCByID(fishingSpotID);
    if(fishingspot != null) {
    if(!tileOnScreen(fishingspot.getLocation())) {
    turnToTile(fishingspot.getLocation(), 15);
    }
    atTile(fishingspot.getLocation(), FISHACTION);
    wait(random(500, 1000));
    }
    }

    public boolean openBank() {
    final RSObject bank = getNearestObjectByID(bankBooth); // search for bank.
    if (bank == null) {
    return false; // did not find the bank.
    }if(!tileOnScreen(bank.getLocation())) {
    turnToTile(bank.getLocation(), 15);
    }
    return atTile(bank.getLocation(), "Use-quickly");
    }

    public void bank() {
    wait (random(2000,3000));
    if(bank.isOpen()) {
    bank.depositAllExcept(lobsterPot, harpoon, coins);
    wait (random(500, 1000));
    }
    }

    private boolean onKaramja() {
    return distanceTo(fishingSpotTile) < 90;
    }

    /**
    *
    * @param g
    * graphics
    * @param posX
    * position x for the bar
    * @param posY
    * position y for the bar
    * @param width
    * width of the bar
    * @param height
    * height of the bar
    * @param Progress
    * progress variable
    * @param color1
    * primary color
    * @param color2
    * secondary color
    * @param text
    * Text color
    */

    public void ProgBar(Graphics g,int posX, int posY, int width, int height, int Progress, Color color1, Color color2, Color text){



    int[] c1 = {color1.getRed() , color1.getGreen() , color1.getBlue() , 150};
    int[] c2 = {color2.getRed() , color2.getGreen() , color2.getBlue() , 150};
    if(c1[0]>230){c1[0]=230;}if(c1[1]>230){c1[1]=230;}if(c1[2]>230){c1[2]=230;}
    if(c2[0]>230){c2[0]=230;}if(c2[1]>230){c2[1]=230;}if(c2[2]>230){c2[2]=230;}

    g.setColor(new Color(c1[0],c1[1],c1[2],200));
    g.fillRoundRect(posX, posY, width, height, 5, 12);
    g.setColor(new Color(c1[0]+25,c1[1]+25,c1[2]+25,200));
    g.fillRoundRect(posX, posY, width, height/2, 5, 12);

    g.setColor(new Color(c2[0],c2[1],c2[2],200));
    g.fillRoundRect(posX, posY, (Progress*width)/100, height, 5, 12);
    g.setColor(new Color(c2[0]+25,c2[1]+25,c2[2]+25,150));
    g.fillRoundRect(posX, posY, (Progress*width)/100, height/2, 5, 12);

    g.setColor(Color.LIGHT_GRAY);
    g.drawRoundRect(posX, posY, width, height, 5, 12);

    g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, height));
    g.setColor(text);
    g.drawString(""+Progress+"% To Next Level", posX+(width/6), posY+(height+height/20));

    }


    private enum Series {FISHING, WALKING_TO_KARAMJA_DOCK, LEAVING_KARMAJA, ON_PORT_SARIM_BOAT, WALKING_TO_BANK, BANKING, WALKING_TO_PORT_SARIM_DOCK, LEAVING_PORT_SARIM, ON_KARAMJA_BOAT, WALKING_TO_FISHING_SPOT, WALK_TO_SHOP, SELL, SHOP_TO_SPOT, DROP_TUNA, CABBAGE_TELE, WALKING_TO_GATE, OPEN_GATE, WALK_FROM_PATCH, error;};
    @SuppressWarnings("deprecation")
    private Series getSeries() {
    try {
    if (playerInArea(FISHING_DOCK_AREA)) {
    if (inventoryContains(tuna)) {
    if(dropTuna) {
    return Series.DROP_TUNA;
    }
    }
    if (isInventoryFull()) {
    if(BANKACTION == "BANK"){
    if (cabbageTele) {
    return Series.CABBAGE_TELE;
    }
    return Series.WALKING_TO_KARAMJA_DOCK;
    }
    if(BANKACTION == "SELL"){
    return Series.WALK_TO_SHOP;
    }
    }
    return Series.FISHING;
    }

    if (playerInArea(KARAMJA_SHIP_AREA)){
    return Series.ON_KARAMJA_BOAT;
    }

    if(playerInArea (SHOP_AREA)) {
    if(isInventoryFull()){
    return Series.SELL;
    }
    if(inventoryContains(lobster)){
    return Series.SELL;
    }
    if(inventoryContains(swordfish)){
    return Series.SELL;
    }
    if(inventoryContains(tuna)){
    return Series.SELL;
    }
    return Series.SHOP_TO_SPOT;
    }


    if (playerInArea(KARAMJA_DOCK_AREA)) {
    if (isInventoryFull()){
    return Series.LEAVING_KARMAJA;
    }
    return Series.WALKING_TO_FISHING_SPOT;
    }

    if (playerInArea(PORT_SARIM_SHIP_AREA)){
    return Series.ON_PORT_SARIM_BOAT;
    }

    if (playerInArea(PORT_SARIM_DOCK_AREA)){
    if(isInventoryFull()) {
    return Series.WALKING_TO_BANK;
    }
    return Series.LEAVING_PORT_SARIM;
    }

    if (playerInArea(DRAYNOR_BANK_AREA)){
    if(isInventoryFull()) {
    return Series.BANKING;
    }
    return Series.WALKING_TO_PORT_SARIM_DOCK;
    }

    if (playerInArea(CABBAGE_PATCH_AREA)) {
    if (distanceTo(gateTile) > 2){
    return Series.WALKING_TO_GATE;
    }
    RSObject Gate = findObject(4, gate);
    if (Gate != null) {
    return Series.OPEN_GATE;
    }else{
    return Series.WALK_FROM_PATCH;
    }
    }

    if(!onKaramja() && !playerInArea(PORT_SARIM_SHIP_AREA) && !playerInArea(CABBAGE_PATCH_AREA)) {
    if(isInventoryFull()) {
    return Series.WALKING_TO_BANK;
    }
    return Series.WALKING_TO_PORT_SARIM_DOCK;
    }

    if(onKaramja() && !playerInArea(KARAMJA_SHIP_AREA)) {
    if(isInventoryFull()) {
    if(BANKACTION == "BANK") {
    return Series.WALKING_TO_KARAMJA_DOCK;
    }
    return Series.WALK_TO_SHOP;
    }
    if(BANKACTION == "BANK") {
    return Series.WALKING_TO_FISHING_SPOT;
    }
    return Series.SHOP_TO_SPOT;
    }

    } catch(Exception e) { }
    return Series.error;
    }

    public int loop() {
    antiBan();
    if (!t.isAlive()) {
    t.start();
    log("AntiBan initialized!");
    }

    try {
    if(isLoggedIn() && !equiptmentCheck) {
    if (FISHACTION == "Cage") {
    openTab(TAB_INVENTORY);
    wait(random(2000, 3000));
    if (inventoryContains(lobsterPot)) {
    equiptmentCheck = true;
    return random(50,150);

    }else {
    log("You do not have a lobster pot in your inventory");
    stopScript();
    return random(500, 1000);
    }
    }
    }
    }catch (Exception e) {
    e.printStackTrace();
    }

    try {
    if(isLoggedIn() && !equiptmentCheck) {
    if (FISHACTION == "Harpoon") {
    openTab(TAB_INVENTORY);
    wait(random(2000, 3000));
    if (inventoryContains(harpoon)) {
    equiptmentCheck = true;
    return random(50,150);

    }else {
    log("You do not have a harpoon in your inventory");
    stopScript();
    return random(500, 1000);
    }
    }
    }
    } catch (Exception e) {
    e.printStackTrace();
    }

    try {
    if (cabbageTele) {
    if(isLoggedIn() && !ringCheck) {
    openTab(TAB_EQUIPMENT);
    wait(random(2000, 3000));
    if (equipmentContains(explorersRing3)) {
    ringCheck = true;
    return random(50,150);

    }else {
    log("You do not have an explorer's ring equiped.");
    log("Please de-select this option on script startup.");
    stopScript();
    return random(500, 1000);
    }
    }
    }
    } catch (Exception e) {
    e.printStackTrace();
    }


    run();

    if(getMyPlayer().getAnimation() != -1) {
    return random(703, 980);
    }

    try{
    switch (getSeries()) {
    case FISHING:
    status = "Fishing";
    fish();
    break;
    case WALKING_TO_KARAMJA_DOCK:
    status = "Walking To Dock";
    walkToKaramjaDock();
    break;
    case LEAVING_KARMAJA:
    status = "Leaving Karamja";
    RSNPC customsofficer = getNearestNPCByID(customsOfficer);
    if(customsofficer != null) {
    if(!tileOnScreen(customsofficer.getLocation())) {
    turnToTile(customsofficer.getLocation(), 15);
    }
    if(!customsofficer.isOnScreen()) {
    walkTileMM(customsofficer.getLocation());
    wait(random(300,700));
    }
    try{
    atNPC (customsofficer,"Pay-Fare");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    break;
    case ON_PORT_SARIM_BOAT:
    status = "On Boat";
    if(distanceTo(portSarimShipTile) >= 1){
    walkTileMM(portSarimShipTile);
    }
    RSObject gangplank = getNearestObjectByID(portSarimPlank);
    if(gangplank != null) {
    if(!tileOnScreen(gangplank.getLocation())) {
    turnToTile(gangplank.getLocation(), 15);
    }
    atTile(gangplank.getLocation(), "Cross");
    wait(random(2000,3000));
    }
    break;
    case WALKING_TO_BANK:
    status = "Walking To Bank";
    walkToBank();
    break;
    case BANKING:
    status = "Banking";
    openBank();
    bank();
    break;
    case WALKING_TO_PORT_SARIM_DOCK:
    status = "Walking To Dock";
    walkToPortSarimDock();
    break;
    case LEAVING_PORT_SARIM:
    status = "Leaving Port Sarim";
    RSNPC sailor = getNearestNPCByID(sailors);
    if(sailor != null) {
    if(!tileOnScreen(sailor.getLocation())) {
    turnToTile(sailor.getLocation(), 15);
    }
    if(!sailor.isOnScreen()) {
    walkTileMM(sailor.getLocation());
    wait(random(300,700));
    }
    try{
    atNPC (sailor,"Pay-Fare");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    break;
    case ON_KARAMJA_BOAT:
    status = "On Boat";
    if(distanceTo(karamjaShipTile) >= 1){
    walkTileMM(karamjaShipTile);
    }
    RSObject karamjagangplank = getNearestObjectByID(karamjaPlank);
    if(karamjagangplank != null) {
    if(!tileOnScreen(karamjagangplank.getLocation())) {
    turnToTile(karamjagangplank.getLocation(), 15);
    }
    atTile(karamjagangplank.getLocation(), "Cross");
    wait(random(2000,3000));
    }
    break;
    case WALKING_TO_FISHING_SPOT:
    status = "Walking To Spot";
    dockToSpot();
    break;
    case WALK_TO_SHOP:
    status = "Walking To Shop";
    spotToShop();
    break;
    case SELL:
    status = "Selling Fish";
    sell();
    break;
    case SHOP_TO_SPOT:
    status = "Walking To Spot";
    walkToSpot();
    break;
    case DROP_TUNA:
    dropTuna();
    break;
    case CABBAGE_TELE:
    status = "Teleporting";
    openTab(TAB_EQUIPMENT);
    atEquippedItem(explorersRing3, "Cabbage");
    wait(random(2000,3000));
    break;
    case WALKING_TO_GATE:
    status = "Leaving Patch";
    walkTileMM(gateTile);
    break;
    case OPEN_GATE:
    status = "Opening Gate";
    atDoorTiles(new RSTile(3053, 3284), new RSTile(3053, 3283));
    wait(random(500, 1000));
    break;
    case WALK_FROM_PATCH:
    walkTileMM(new RSTile(3060, 3277));
    wait(random(500, 1000));
    break;
    case error:
    break;
    }
    }catch(Exception e){
    e.printStackTrace();
    }

    return random(2500, 3000);
    }
    }

    class QckKaramjaFisherAntiBan implements Runnable {
    public boolean stopThread;

    public void run() {
    Random random = new Random();
    while (!stopThread) {
    try {
    if (random.nextInt(Math.abs(15 - 0)) == 0) {
    final char[] LR = new char[] { KeyEvent.VK_LEFT,
    KeyEvent.VK_RIGHT };
    final char[] UD = new char[] { KeyEvent.VK_DOWN,
    KeyEvent.VK_UP };
    final char[] LRUD = new char[] { KeyEvent.VK_LEFT,
    KeyEvent.VK_RIGHT, KeyEvent.VK_UP, KeyEvent.VK_UP };
    final int random2 = random.nextInt(Math.abs(2 - 0));
    final int random1 = random.nextInt(Math.abs(2 - 0));
    final int random4 = random.nextInt(Math.abs(4 - 0));

    if (random.nextInt(Math.abs(3 - 0)) == 0) {
    Bot.getInputManager().pressKey(LR[random1]);
    Thread.sleep(random.nextInt(Math.abs(400 - 100)));
    Bot.getInputManager().pressKey(UD[random2]);
    Thread.sleep(random.nextInt(Math.abs(600 - 300)));
    Bot.getInputManager().releaseKey(UD[random2]);
    Thread.sleep(random.nextInt(Math.abs(400 - 100)));
    Bot.getInputManager().releaseKey(LR[random1]);
    } else {
    Bot.getInputManager().pressKey(LRUD[random4]);
    if (random4 > 1) {
    Thread.sleep(random.nextInt(Math.abs(600 - 300)));
    } else {
    Thread.sleep(random.nextInt(Math.abs(900 - 500)));
    }
    Bot.getInputManager().releaseKey(LRUD[random4]);
    }
    } else {
    Thread.sleep(random.nextInt(Math.abs(2000 - 200)));
    }
    } catch (Exception e) {
    System.out.println("AntiBan error detected!");
    }
    }
    }
    }

      Current date/time is Thu Mar 28, 2024 4:01 am