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

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 52.69 KB  |  hits: 20  |  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.  
  2. /*
  3. * ZombieFisherEXTREME V7.51
  4. *
  5. * Credits:
  6. * BamBino/cronshaw1234/Zorlix - Updaters
  7. * Carmera Spin/Harpoon update - Lone Spartan
  8. * Welcome - Ruski
  9. * TBT and Aelin for scripting this.
  10. * The Immortal for letting me use his paint thingy :D
  11. */
  12.  
  13. import java.awt.event.*;
  14. import java.io.*;
  15. import java.net.*;
  16. import java.awt.Color;
  17. import java.awt.Graphics;
  18. import java.io.IOException;
  19. import java.lang.reflect.Method;
  20. import java.util.Map;
  21. import javax.swing.JOptionPane;
  22.  
  23. import org.rsbot.util.ScreenshotUtil;
  24. import org.rsbot.bot.Bot;
  25. import org.rsbot.script.ScriptManifest;
  26. import org.rsbot.event.events.ServerMessageEvent;
  27. import org.rsbot.event.listeners.PaintListener;
  28. import org.rsbot.event.listeners.ServerMessageListener;
  29. import org.rsbot.script.wrappers.RSInterface;
  30. import org.rsbot.script.wrappers.RSItemTile;
  31. import org.rsbot.script.wrappers.RSNPC;
  32. import org.rsbot.script.wrappers.RSObject;
  33. import org.rsbot.script.wrappers.RSPlayer;
  34. import org.rsbot.script.wrappers.RSTile;
  35. import org.rsbot.script.*;
  36.  
  37.  
  38. @ScriptManifest(authors = {"ZombieKnight"}, category = "Fishing", name = "ZombieFisherEXTREME", version = 7.51, description = "<html><head><style type='text/css'> hr {color: white} p {margin-left: 20px}</style></head><body><center><b><font size='4' color='Blue'>ZombieFisherEXTREME v7.51</font></b><br></center><center><table border='0'><tr><td colspan='2'><center><font size='4'><b>:: Script Settings ::</b></font></center></td></tr><tr><td colspan='2'><hr></td></tr><tr><td><center><table border='0'><tr><td colspan='2'><center><font size='4'><b>Contact me at ZombieKnight_RSBot@hotmail.com</b></font></center></td></tr><tr><td colspan='2'><hr></td></tr><tr><td><tr><td><b>Location: </b></td><td><center><select name='locationName'><option>Al-Kharid<option>Barb Village(EV)<option>Catherby<option>Draynor<option>Fishing Guild<option>Otto-Grotto<option>[STILES]Karamja<option>Shilo<option>Piscatoris</select></center></td></tr><tr><td><b>Catch: </b></td><td><center><select name='catchName'><option>Pike<option>Bass/Cod/Mackerel<option>Shrimp/Anchovies<option>Herring/Sardines<option>Leaping<option>Trout/Salmon<option>Tuna/Swordfish<option>Tuna/Swordfish(CHARPOON)<option>Lobsters<option>Sharks<option>Sharks(CHARPOON)<option>Rainbow Fish<option>Monkfish</select></center></td></tr><tr><td><b>Paint Color: </b></td><td><center><select name='pColor'><option>PinkPanther<option>SunKist<option>ClearSky<option>Monochrome<option>Nightmare<option>BloodShed</select></center></td></tr><tr><td><b>ZombieWalking:</b></td><td><center><input type=\"checkbox\" name=\"zombieWalking\" value=\"true\"><B>Yes</b></center></td></tr><tr><td><b>AntiTunas:</b></td><td><center><input type=\"checkbox\" name=\"antiTunas\" value=\"true\"><B>Yes</b></center></td></tr><tr><td><b>Powerfishing Mode:</b></td><td><center><input type='checkbox' name='powerFishing' value='true'><B>Yes</b></center></td></tr><tr><td><b>Wield Equipment:</b></td><td><center><input type='checkbox' name='barbarianMode' value='true'><B>Yes</b></center></td></tr><tr><td><b>Paint Report:</b></td><td><center><input type='checkbox' name='usePaint' checked='true' value='true'><B>Yes</b></center></td></tr></table><center><p>For Support/Comments, Pls click <a href='http://www.rsbot.org/vb/showthread.php?t=52649'>HERE</a></p><center><center><p>For Suggestions/Requests/Bug reports, Pls click <a href='http://www.rsbot.org/vb/showthread.php?t=48599'>HERE</a></p><center></center></body></html>")
  39. public class ZombieFisher extends Script implements ServerMessageListener, PaintListener {
  40.         int randomInt;
  41.         int GambleInt;
  42.        
  43.         @Override
  44.         protected int getMouseSpeed() {
  45.            if (powerFishing)
  46.                 return random(8, 10);
  47.            else
  48.                 return random(3, 5);
  49.         }
  50.  
  51.  
  52.         // State constants:
  53.         public final int S_WALKTO_BANK = 100;
  54.         public final int S_WALKTO_SPOT = 200;
  55.         public final int S_FISH = 300;
  56.         public final int S_TUNA = 400;
  57.         public final int S_THROW_TUNAS = 500;
  58.         public final int S_DROP_ALL = 600;
  59.         public final int S_USE_BANK = 700;
  60.         public final int S_DEPOSIT = 800;
  61.         public final int S_WITHDRAW = 900;
  62.  
  63.  
  64.         // Bait constants:
  65.         public final int BAIT_NONE = -1;
  66.         public final int BAIT_BAIT = 313;
  67.         public final int BAIT_FEATHERS = 314;
  68.         public final int BAIT_STRIPY = 10087;
  69.  
  70.         // Gear constants:
  71.         public final int GEAR_NET = 303;
  72.         public final int GEAR_ROD = 307;
  73.         public final int GEAR_FLYROD = 309;
  74.         public final int GEAR_HEAVYROD = 11323;
  75.         public final int GEAR_CAGE = 301;
  76.         public final int GEAR_CHARPOON = 14109;
  77.         public final int GEAR_HARPOON = 311;
  78.         public final int GEAR_BIGNET = 305;
  79.         public final int GEAR_BARB = 10129;
  80.         public final int GEAR_NONE = -1;
  81.  
  82.         // Paths and tiles:
  83.         public RSTile[] toBank;
  84.         public RSTile[] toArea;
  85.         RSTile[] lostTiles = new RSTile[]{new RSTile(2860, 3428), new RSTile(2863, 2978), new RSTile(2835, 2975)};
  86.         RSTile[] recoverTiles = new RSTile[]{new RSTile(2849, 3430), new RSTile(2855, 2971), new RSTile(2850, 2970)};
  87.  
  88.         // Runtime configuration.
  89.         public int currentGear;
  90.         public int currentBait;
  91.         public String currentCommand;
  92.         public int fishingSpotID;
  93.         public int bankID;
  94.         public int shopID;
  95.         public boolean usesNPCBanking;
  96.  
  97.         // Script configuration.
  98.         public String locationName;
  99.         public String catchName;
  100.         public String pColor;
  101.         public boolean barbarianMode;
  102.         public boolean powerFishing;
  103.         public boolean antiTunas;
  104.         public boolean zombieWalking;
  105.         public boolean usePaint;
  106.         public boolean Sound;
  107.         public boolean isPvP;
  108.         public boolean hasEquipped;
  109.         public long oldCatches = 0;
  110.         public long catches = 0;
  111.  
  112.         // Misc variables.
  113.         public int currentFails = 0;
  114.         public int randomRunEnergy;
  115.         public int state = S_FISH;
  116.         public boolean runningFromCombat;
  117.         public long scriptStartTime;
  118.         public int playerStartXP;
  119.         public int numberOfCatches;
  120.         public long lastCheck;
  121.         public long checkTime;
  122.         public int countToNext = 0;
  123.         public int timesAvoidedCombat;
  124.         public int whirlpoolsAvoided;
  125.         public int timesRecoveredGear;
  126.         public int startLevel;
  127.         public int lastExp;
  128.         public int xpPerCatch = 0;
  129.         public int oldExp;
  130.         public int updateCheck = 0;
  131.         public RSPlayer PvPPlayer;
  132.         public int sCB;
  133.         public int startExp;
  134.         public boolean sRM;
  135.         public boolean StartedY;
  136.  
  137.  
  138.         public int[] whirlpools = new int[]{
  139.                         403, 404, 406, 406};
  140.  
  141.         int[] equipItems = {10129, 14109};
  142.  
  143.         int[] itemIDs = {10129, 14109};
  144.  
  145.         public void turnCamera() {
  146.                 char[] LR = new char[]{KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT};
  147.                 char[] UD = new char[]{KeyEvent.VK_DOWN, KeyEvent.VK_UP};
  148.                 char[] LRUD = new char[]{KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
  149.                                 KeyEvent.VK_UP, KeyEvent.VK_DOWN};
  150.                 int random2 = random(0, 4);
  151.                 int random1 = random(0, 4);
  152.                 int random4 = random(0, 4);
  153.  
  154.                 if (random(0, 2) == 2) {
  155.                         Bot.getInputManager().pressKey(LR[random1]);
  156.                         try {
  157.                                 Thread.sleep(random(100, 400));
  158.                         } catch (Exception e) {
  159.                         }
  160.                         Bot.getInputManager().pressKey(UD[random2]);
  161.                         try {
  162.                                 Thread.sleep(random(300, 600));
  163.                         } catch (Exception e) {
  164.                         }
  165.                         Bot.getInputManager().releaseKey(UD[random2]);
  166.                         try {
  167.                                 Thread.sleep(random(100, 400));
  168.                         } catch (Exception e) {
  169.                         }
  170.                         Bot.getInputManager().releaseKey(LR[random1]);
  171.                 } else {
  172.                         Bot.getInputManager().pressKey(LRUD[random4]);
  173.                         if (random4 > 1) {
  174.                                 try {
  175.                                         Thread.sleep(random(300, 600));
  176.                                 } catch (Exception e) {
  177.                                 }
  178.                         } else {
  179.                                 try {
  180.                                         Thread.sleep(random(500, 900));
  181.                                 } catch (Exception e) {
  182.                                 }
  183.                         }
  184.                         Bot.getInputManager().releaseKey(LRUD[random4]);
  185.                 }
  186.         }
  187.  
  188.         /*
  189.                  * Pre-runtime configuration takes place within this method.
  190.                  */
  191.         public boolean onStart(final Map<String, String> args) {
  192.  
  193.                 final int welcome = JOptionPane
  194.                                 .showConfirmDialog(
  195.                                                 null,
  196.                                                 "Before using my script, would you like to thank me\nby clicking some adverts?",
  197.                                                 "Welcome", JOptionPane.YES_NO_OPTION);
  198.                 if (welcome == 0) {
  199.                         final String message = "<html><h1>Thank you for your support!</h1><br/>"
  200.                                         + "<p>You will now be redirected to my adverts page. <br/>"
  201.                                         + "Click the adverts on the page few times a day if you can.</p>"
  202.                                         + "</html>";
  203.                         JOptionPane.showMessageDialog(null, message);
  204.                         openURL("http://49237d3d.tinybucks.net");
  205.                 }
  206.                 Reset();
  207.                 checkupdate();
  208.                 // Set script start time
  209.                 scriptStartTime = System.currentTimeMillis();
  210.                 // Load script configuration from arguements.
  211.                 locationName = args.get("locationName");
  212.                 catchName = args.get("catchName");
  213.                 pColor = args.get("pColor");
  214.                 barbarianMode = args.get("barbarianMode") != null ? true : false;
  215.                 powerFishing = args.get("powerFishing") != null ? true : false;
  216.                 antiTunas = args.get("antiTunas") != null ? true : false;
  217.                 usePaint = args.get("usePaint") != null ? true : false;
  218.                 isPvP = args.get("PvPWorld") != null ? true : false;
  219.                 Sound = args.get("wSound") != null ? true : false;
  220.                 zombieWalking = args.get("zombieWalking") != null ? true : false;
  221.  
  222.                 if (catchName.equals("Trout/Salmon")) {
  223.                         log.severe("Please buy your feathers for the lowest price in the Grand Exchange.");
  224.                         log.severe("I thank you for doing that, the current price for feathers is too high.");
  225.                         log.severe("So, please help us out in the quest of bringing it down.");
  226.  
  227.                 }
  228.                  
  229.                 // Al Kharid locations:
  230.                 if (locationName.equals("Al-Kharid")) {
  231.                         log("Setting Mummyfied paths for Al-Kharid.");
  232.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  233.                         toBank = new RSTile[]{new RSTile(3271, 3144), new RSTile(3276, 3157), new RSTile(3270, 3167)};
  234.                         toArea = reversePath(toBank);
  235.                         usesNPCBanking = true;
  236.  
  237.                         if (catchName.equals("Shrimp/Anchovies")) {
  238.                                 currentGear = GEAR_NET;
  239.                                 currentBait = BAIT_NONE;
  240.                                 fishingSpotID = 330;
  241.                                 currentCommand = "Net";
  242.                                 bankID = 35647;
  243.                                 return true;
  244.                         }
  245.  
  246.                         if (catchName.equals("Herring/Sardines")) {
  247.                                 currentGear = GEAR_ROD;
  248.                                 currentBait = BAIT_BAIT;
  249.                                 fishingSpotID = 330;
  250.                                 currentCommand = "Bait";
  251.                                 bankID = 35647;
  252.                                 return true;
  253.                         }
  254.                 }
  255.  
  256.                
  257.                 if (locationName.equals("Otto-Grotto")) {
  258.                         log("[Reminder]Pls start at the fishing spots.");
  259.                         toBank = new RSTile[]{ new RSTile(3101,3432), new RSTile(3097,3438), new RSTile(3091,3444), new RSTile(3090,3455), new RSTile(3087,3463), new RSTile(3081,3467), new RSTile(3079,3476), new RSTile(3080,3483), new RSTile(3085,3488), new RSTile(3093,3490)};
  260.                         toArea = reversePath(toBank);
  261.                         usesNPCBanking = true;
  262.  
  263.  
  264.                         if (catchName.equals("Leaping")) {
  265.                                 currentGear = GEAR_HEAVYROD;
  266.                                 currentBait = BAIT_FEATHERS;
  267.                                 fishingSpotID = 2722;
  268.                                 currentCommand = "Use-rod";
  269.                                 bankID = 26972;
  270.                                 return true;
  271.                         }
  272.  
  273.                 }
  274.  
  275.                 // Barbarian Village locations:
  276.                 if (locationName.equals("Barb Village(EV)")) {
  277.                         log("Setting Mummyfied paths for Barbarian Village(EV).");
  278.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  279.                         toBank = new RSTile[]{ new RSTile(3101,3432), new RSTile(3097,3438), new RSTile(3091,3444), new RSTile(3090,3455), new RSTile(3087,3463), new RSTile(3081,3467), new RSTile(3079,3476), new RSTile(3080,3483), new RSTile(3085,3488), new RSTile(3092,3492)};
  280.                         toArea = reversePath(toBank);
  281.                         usesNPCBanking = true;
  282.  
  283.  
  284.                         if (catchName.equals("Pike")) {
  285.                                 currentGear = GEAR_ROD;
  286.                                 currentBait = BAIT_BAIT;
  287.                                 fishingSpotID = 328;
  288.                                 currentCommand = "Bait";
  289.                                 bankID = 26972;
  290.                                 return true;
  291.                         }
  292.  
  293.                         if (catchName.equals("Trout/Salmon")) {
  294.                                 currentGear = GEAR_FLYROD;
  295.                                 currentBait = BAIT_FEATHERS;
  296.                                 fishingSpotID = 328;
  297.                                 currentCommand = "Lure";
  298.                                 bankID = 26972;
  299.                                 return true;
  300.                         }
  301.  
  302.                         if (catchName.equals("Rainbow Fish")) {
  303.                                 currentGear = GEAR_FLYROD;
  304.                                 currentBait = BAIT_STRIPY;
  305.                                 fishingSpotID = 328;
  306.                                 currentCommand = "Lure";
  307.                                 bankID = 26972;
  308.                                 return true;
  309.                         }
  310.                 }
  311.  
  312.                 // Catherby locations:
  313.                 if (locationName.equals("Catherby")) {
  314.                         log("Setting Mummyfied paths for Catherby.");
  315.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  316.                         toBank = new RSTile[]{new RSTile(2852,3430), new RSTile(2839,3434), new RSTile(2830,3437), new RSTile(2820,3438), new RSTile(2809,3440)};
  317.                         toArea = reversePath(toBank);
  318.                         usesNPCBanking = true;
  319.  
  320.  
  321.                         if (catchName.equals("Bass/Cod/Mackerel")) {
  322.                                 currentGear = GEAR_BIGNET;
  323.                                 currentBait = BAIT_NONE;
  324.                                 fishingSpotID = 322;
  325.                                 currentCommand = "Net";
  326.                                 bankID = 2213;
  327.                                 return true;
  328.                         }
  329.  
  330.                         if (catchName.equals("Shrimp/Anchovies")) {
  331.                                 currentGear = GEAR_NET;
  332.                                 currentBait = BAIT_NONE;
  333.                                 fishingSpotID = 320;
  334.                                 currentCommand = "Net";
  335.                                 bankID = 2213;
  336.                                 return true;
  337.                         }
  338.  
  339.                         if (catchName.equals("Herring/Sardines")) {
  340.                                 currentGear = GEAR_ROD;
  341.                                 currentBait = BAIT_BAIT;
  342.                                 fishingSpotID = 320;
  343.                                 currentCommand = "Bait";
  344.                                 bankID = 2213;
  345.                                 return true;
  346.                         }
  347.  
  348.                         if (catchName.equals("Lobsters")) {
  349.                                 currentGear = GEAR_CAGE;
  350.                                 currentBait = BAIT_NONE;
  351.                                 fishingSpotID = 321;
  352.                                 currentCommand = "Cage";
  353.                                 bankID = 2213;
  354.                                 return true;
  355.                         }
  356.  
  357.                         if (catchName.equals("Tuna/Swordfish")) {
  358.                                 currentGear = GEAR_HARPOON;
  359.                                 currentBait = BAIT_NONE;
  360.                                 fishingSpotID = 321;
  361.                                 currentCommand = "Harpoon";
  362.                                 bankID = 2213;
  363.                                 return true;
  364.                         }
  365.  
  366.  
  367.                         if (catchName.equals("Tuna/Swordfish(CHARPOON")) {
  368.                                 currentGear = GEAR_CHARPOON;
  369.                                 currentBait = BAIT_NONE;
  370.                                 fishingSpotID = 321;
  371.                                 currentCommand = "Harpoon";
  372.                                 bankID = 2213;
  373.                                 return true;
  374.                         }
  375.  
  376.                         if (catchName.equals("Sharks")) {
  377.                                 currentGear = GEAR_HARPOON;
  378.                                 currentBait = BAIT_NONE;
  379.                                 fishingSpotID = 322;
  380.                                 currentCommand = "Harpoon";
  381.                                 bankID = 2213;
  382.                                 return true;
  383.                         }
  384.  
  385.  
  386.                         if (catchName.equals("Sharks(CHARPOON")) {
  387.                                 currentGear = GEAR_CHARPOON;
  388.                                 currentBait = BAIT_NONE;
  389.                                 fishingSpotID = 322;
  390.                                 currentCommand = "Harpoon";
  391.                                 bankID = 2213;
  392.                                 return true;
  393.                         }
  394.  
  395.                 }
  396.  
  397.  
  398.                 // Draynor locations.
  399.                 if (locationName.equals("Draynor")) {
  400.                         // Setup draynor paths.
  401.                         log("Setting Mummyfied paths for Draynor.");
  402.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  403.                         toBank = new RSTile[]{new RSTile(3086, 3232), new RSTile(3093, 3242)};
  404.                         toArea = reversePath(toBank);
  405.                         usesNPCBanking = true;
  406.  
  407.                         if (catchName.equals("Shrimp/Anchovies")) {
  408.                                 currentGear = GEAR_NET;
  409.                                 currentBait = BAIT_NONE;
  410.                                 fishingSpotID = 327;
  411.                                 currentCommand = "Net";
  412.                                 bankID = 2213;
  413.                                 return true;
  414.                         }
  415.  
  416.                         if (catchName.equals("Herring/Sardines")) {
  417.                                 currentGear = GEAR_ROD;
  418.                                 currentBait = BAIT_BAIT;
  419.                                 fishingSpotID = 327;
  420.                                 currentCommand = "Bait";
  421.                                 bankID = 2213;
  422.                                 return true;
  423.                         }
  424.                 }
  425.  
  426.                 if (locationName.equals("Fishing Guild")) {
  427.                         log("Setting Mummyfied paths for the Fishing Guild.");
  428.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  429.  
  430.                         toBank = new RSTile[]{new RSTile(2595, 3416), new RSTile(2586, 3422)};
  431.                         toArea = new RSTile[]{new RSTile(2597, 3420)};
  432.                         usesNPCBanking = true;
  433.  
  434.                         if (catchName.equals("Bass/Cod/Mackerel")) {
  435.                                 currentGear = GEAR_BIGNET;
  436.                                 currentBait = BAIT_NONE;
  437.                                 fishingSpotID = 313;
  438.                                 currentCommand = "Net";
  439.                                 bankID = 49018;
  440.                                 return true;
  441.                         }
  442.                         if (catchName.equals("Lobsters")) {
  443.                                 currentGear = GEAR_CAGE;
  444.                                 currentBait = BAIT_NONE;
  445.                                 fishingSpotID = 312;
  446.                                 currentCommand = "Cage";
  447.                                 bankID = 49018;
  448.                                 return true;
  449.                         }
  450.  
  451.                         if (catchName.equals("Tuna/Swordfish")) {
  452.                                 currentGear = GEAR_HARPOON;
  453.                                 currentBait = BAIT_NONE;
  454.                                 fishingSpotID = 312;
  455.                                 currentCommand = "Harpoon";
  456.                                 bankID = 49018;
  457.                                 return true;
  458.                         }
  459.  
  460.                         if (catchName.equals("Tuna/Swordfish(CHARPOON)")) {
  461.                                 currentGear = GEAR_CHARPOON;
  462.                                 currentBait = BAIT_NONE;
  463.                                 fishingSpotID = 312;
  464.                                 currentCommand = "Harpoon";
  465.                                 bankID = 49018;
  466.                                 return true;
  467.                         }
  468.                         if (catchName.equals("Sharks")) {
  469.                                 currentGear = GEAR_HARPOON;
  470.                                 currentBait = BAIT_NONE;
  471.                                 fishingSpotID = 313;
  472.                                 currentCommand = "Harpoon";
  473.                                 bankID = 49018;
  474.                                 return true;
  475.                         }
  476.  
  477.                         if (catchName.equals("Sharks(CHARPOON)")) {
  478.                                 currentGear = GEAR_CHARPOON;
  479.                                 currentBait = BAIT_NONE;
  480.                                 fishingSpotID = 313;
  481.                                 currentCommand = "Harpoon";
  482.                                 bankID = 49018;
  483.                                 return true;
  484.                         }
  485.                 }
  486.  
  487.                 if (locationName.equals("[STILES]Karamja")) {
  488.                         log("Setting Mummyfied paths for Karamja");
  489.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  490.                         toBank = new RSTile[]{new RSTile(2913,3171), new RSTile(2901,3169), new RSTile(2895,3162), new RSTile(2885,3158), new RSTile(2875,3150), new RSTile(2867,3149), new RSTile(2860,3146), new RSTile(2852,3143)};
  491.  
  492.  
  493.                         toArea = reversePath(toBank);
  494.                         usesNPCBanking = true;
  495.  
  496.  
  497.                         if (catchName.equals("Lobsters")) {
  498.                                 currentGear = GEAR_CAGE;
  499.                                 currentBait = BAIT_NONE;
  500.                                 fishingSpotID = 324;
  501.                                 currentCommand = "Cage";
  502.                                 bankID = 11267;
  503.                                 return true;
  504.                         }
  505.  
  506.                         if (catchName.equals("Tuna/Swordfish")) {
  507.                                 currentGear = GEAR_HARPOON;
  508.                                 currentBait = BAIT_NONE;
  509.                                 fishingSpotID = 324;
  510.                                 currentCommand = "Harpoon";
  511.                                 bankID = 11267;
  512.                                 return true;
  513.                         }
  514.  
  515.                 }
  516.  
  517.  
  518.                 if (locationName.equals("Karamja")) {
  519.                         log("Setting Mummyfied paths for Karamja");
  520.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  521.                         toBank = new RSTile[]{new RSTile(2925, 3177), new RSTile(2924, 3166), new RSTile(2929, 3152),
  522.                                         new RSTile(2942, 3146),
  523.  
  524.                                         /*new RSTile(2954, 3146), new RSTile(3032, 3217),*/
  525.  
  526.                                         new RSTile(3029, 3217), new RSTile(3027, 3222), new RSTile(3027, 3230),
  527.                                         new RSTile(3041, 3238), new RSTile(3051, 3246), new RSTile(3068, 3248),
  528.                                         new RSTile(3080, 3250), new RSTile(3092, 3243)};//PortSarim
  529.  
  530.  
  531.                         toArea = reversePath(toBank);
  532.                         toArea = reversePath(toBank);
  533.                         usesNPCBanking = true;
  534.  
  535.                         if (catchName.equals("Shrimp/Anchovies")) {
  536.                                 currentGear = GEAR_NET;
  537.                                 currentBait = BAIT_NONE;
  538.                                 fishingSpotID = 323;
  539.                                 currentCommand = "Net";
  540.                                 bankID = 495;
  541.                                 return true;
  542.                         }
  543.  
  544.                         if (catchName.equals("Herring/Sardines")) {
  545.                                 currentGear = GEAR_ROD;
  546.                                 currentBait = BAIT_BAIT;
  547.                                 fishingSpotID = 323;
  548.                                 currentCommand = "Bait";
  549.                                 bankID = 495;
  550.                                 return true;
  551.                         }
  552.  
  553.                         if (catchName.equals("Lobsters")) {
  554.                                 currentGear = GEAR_CAGE;
  555.                                 currentBait = BAIT_NONE;
  556.                                 fishingSpotID = 324;
  557.                                 currentCommand = "Cage";
  558.                                 bankID = 495;
  559.                                 return true;
  560.                         }
  561.  
  562.                         if (catchName.equals("Tuna/Swordfish")) {
  563.                                 currentGear = GEAR_HARPOON;
  564.                                 currentBait = BAIT_NONE;
  565.                                 fishingSpotID = 324;
  566.                                 currentCommand = "Harpoon";
  567.                                 bankID = 495;
  568.                                 return true;
  569.                         }
  570.  
  571.                 }
  572.  
  573.  
  574.                 if (locationName.equals("Shilo")) {
  575.                         log("Setting Mummyfied paths for Shilo.");
  576.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  577.                         toBank = new RSTile[]{new RSTile(2864, 2971),
  578.                                         new RSTile(2850, 2967), new RSTile(2852, 2953)};
  579.  
  580.                         toArea = reversePath(toBank);
  581.                         usesNPCBanking = true;
  582.  
  583.                         if (catchName.equals("Trout/Salmon")) {
  584.                                 currentGear = GEAR_FLYROD;
  585.                                 currentBait = BAIT_FEATHERS;
  586.                                 fishingSpotID = 317;
  587.                                 currentCommand = "Lure";
  588.                                 bankID = 499;
  589.                                 return true;
  590.                         }
  591.  
  592.                         if (catchName.equals("Pike")) {
  593.                                 currentGear = GEAR_ROD;
  594.                                 currentBait = BAIT_BAIT;
  595.                                 fishingSpotID = 317;
  596.                                 currentCommand = "Bait";
  597.                                 bankID = 499;
  598.                                 return true;
  599.                         }
  600.                 }
  601.  
  602.                 if (locationName.equals("Piscatoris")) {
  603.                         log("Setting Mummyfied paths for Piscatoris");
  604.                         log("[Reminder]Pls start in the bank or at the fishing spots.");
  605.                         toBank = new RSTile[]{new RSTile(2339, 3697), new RSTile(2322, 3696), new RSTile(2331, 3689)};
  606.                         toArea = new RSTile[]{new RSTile(2339, 3697)};
  607.                         usesNPCBanking = true;
  608.  
  609.                         if (catchName.equals("Monkfish")) {
  610.                                 currentGear = GEAR_NET;
  611.                                 currentBait = BAIT_NONE;
  612.                                 fishingSpotID = 3848;
  613.                                 currentCommand = "Net";
  614.                                 bankID = 3824;
  615.                                 return true;
  616.                         }
  617.  
  618.                         if (catchName.equals("Tuna/Swordfish")) {
  619.                                 currentGear = GEAR_HARPOON;
  620.                                 currentBait = BAIT_NONE;
  621.                                 fishingSpotID = 3848;
  622.                                 currentCommand = "Harpoon";
  623.                                 bankID = 3824;
  624.                                 return true;
  625.                         }
  626.                         if (catchName.equals("Tuna/Swordfish(BARB)")) {
  627.                                 currentGear = GEAR_NONE;
  628.                                 currentBait = BAIT_NONE;
  629.                                 fishingSpotID = 3848;
  630.                                 currentCommand = "Harpoon";
  631.                                 bankID = 3824;
  632.                                 return true;
  633.                         }
  634.                         if (catchName.equals("Tuna/Swordfish(CHARPOON)")) {
  635.                                 currentGear = GEAR_CHARPOON;
  636.                                 currentBait = BAIT_NONE;
  637.                                 fishingSpotID = 3848;
  638.                                 currentCommand = "Harpoon";
  639.                                 bankID = 3824;
  640.                                 return true;
  641.                         }
  642.  
  643.  
  644.                 }
  645.  
  646.                 log("Unable to start script: Invalid combination of parameters.");
  647.                 return false;
  648.         }
  649.  
  650.  
  651.         public void onFinish() {
  652.                 // Takes a screen shot when u stop the script.
  653.                 ScreenshotUtil.takeScreenshot(true);
  654.  
  655.                 // Remove listeners.
  656.                 Bot.getEventManager().removeListener(PaintListener.class, this);
  657.                 Bot.getEventManager().removeListener(ServerMessageListener.class, this);
  658.         }
  659.  
  660.  
  661.         final ScriptManifest props = getClass().getAnnotation(
  662.                         ScriptManifest.class);
  663.  
  664.         public void checkupdate() {
  665.                 double curV = getOVersion();
  666.                 if (curV > props.version()) {
  667.                         log.severe("Please update your ZombieFisher to v" + curV);
  668.                         return;
  669.                 } else {
  670.                         log("You've got latest ZombieFisher");
  671.                 }
  672.                 return;
  673.         }
  674.  
  675.         public void checkupdate2() {
  676.                 double curV = getOVersion();
  677.                 if (curV > props.version()) {
  678.                         log.severe("A new update was just released! Pls refer to the thread for more details.");
  679.                         beep(5);
  680.                         return;
  681.                 }
  682.                 return;
  683.         }
  684.  
  685.         //If the URL doesnt work, try this http://zombiebboi12.webs.com/Version
  686.         public static double getOVersion() {
  687.                 try {
  688.                         URL url = new URL("http://preview8.awardspace.com/zombiebboi12.co.cc/");
  689.                         BufferedReader br = new BufferedReader(new InputStreamReader(
  690.                                         new BufferedInputStream(url.openConnection().getInputStream())));
  691.                         double ver = Double.parseDouble(br.readLine().trim());
  692.                         br.close();
  693.                         return ver;
  694.                 } catch (IOException e) {
  695.                         throw new RuntimeException(e);
  696.                 }
  697.         }
  698.  
  699.         public void Reset() {
  700.                 StartedY = false;
  701.                 currentFails = 0;
  702.         }
  703.  
  704.         public void openURL(final String url) { // Credits to Dave who gave credits
  705.                 // to
  706.                 // some guy who made this.
  707.                 final String osName = System.getProperty("os.name");
  708.                 try {
  709.                         if (osName.startsWith("Mac OS")) {
  710.                                 final Class<?> fileMgr = Class
  711.                                                 .forName("com.apple.eio.FileManager");
  712.                                 final Method openURL = fileMgr.getDeclaredMethod("openURL",
  713.                                                 new Class[]{String.class});
  714.                                 openURL.invoke(null, new Object[]{url});
  715.                         } else if (osName.startsWith("Windows")) {
  716.                                 Runtime.getRuntime().exec(
  717.                                                 "rundll32 url.dll,FileProtocolHandler " + url);
  718.                         } else { // assume Unix or Linux
  719.                                 final String[] browsers = {"firefox", "opera", "konqueror",
  720.                                                 "epiphany", "mozilla", "netscape"};
  721.                                 String browser = null;
  722.                                 for (int count = 0; count < browsers.length && browser == null; count++) {
  723.                                         if (Runtime.getRuntime().exec(
  724.                                                         new String[]{"which", browsers[count]})
  725.                                                         .waitFor() == 0) {
  726.                                                 browser = browsers[count];
  727.                                         }
  728.                                 }
  729.                                 if (browser == null) {
  730.                                         throw new Exception("Could not find web browser");
  731.                                 } else {
  732.                                         Runtime.getRuntime().exec(new String[]{browser, url});
  733.                                 }
  734.                         }
  735.                 } catch (final Exception e) {
  736.                 }
  737.         }
  738.  
  739.  
  740.         public int loop() {
  741.  
  742.                 randomInt = random(1, 17);
  743.                 GambleInt = random(1, 17);
  744.                 if (GambleInt == 1) {
  745.                         turnCamera();
  746.                 }
  747.  
  748.                 if (!isLoggedIn() || isWelcomeButton() || !StartedY) {
  749.                         StartedY = true;
  750.                         wait(1000);
  751.                         return random(250, 500);
  752.                 }
  753.                 if (barbarianMode && currentGear != GEAR_NONE) {
  754.  
  755.  
  756.                 }
  757.                 if (barbarianMode && currentGear != GEAR_NONE) {
  758.  
  759.  
  760.                 }
  761.  
  762.                 if (currentFails >= 1000) {
  763.                         log.severe("The script failed 100 times, and will now stop as a failsafe.");
  764.                         ScreenshotUtil.takeScreenshot(isLoggedIn());
  765.                         if (checkForLogout()) stopScript();
  766.                 }
  767.  
  768.  
  769.                 switch (state) {
  770.                         case S_WALKTO_BANK:
  771.  
  772.                                if (zombieWalking)
  773.                                 return zombieWalkBank();
  774.                            else
  775.                                 return walkToBank();
  776.  
  777.                         case S_THROW_TUNAS:
  778.                                 return throwTunas();
  779.  
  780.                         case S_WALKTO_SPOT:
  781.  
  782.                                 if (zombieWalking)
  783.                                 return zombieWalkSpots();
  784.                            else
  785.                                 return walkToSpots();
  786.  
  787.                         case S_FISH:
  788.                                 if (antiTunas)
  789.                                         return stateTuna();
  790.                                 else
  791.                                         return stateFish();
  792.  
  793.                         case S_DROP_ALL:
  794.                                 return dropAll();
  795.  
  796.                         case S_USE_BANK:
  797.                                 if (usesNPCBanking)
  798.                                   if (locationName.equals("[STILES]Karamja"))
  799.                                         return tradeAllKaramja();
  800.                                 else if (locationName.equals("Piscatoris"))
  801.                                                 return useBankNPCPiscatoris();
  802.                                 else if (locationName.equals("Shilo"))
  803.                                                 return useBankNPCShilo();
  804.                                         else
  805.                                                 return useBank();
  806.                                 else
  807.                                                 return useBankNPC();
  808.  
  809.                         case S_DEPOSIT:
  810.                                
  811.                                  if (locationName.equals("Karamja"))
  812.                                         return depositAllKaramja();
  813.                                 else
  814.                                         return depositAllRest();
  815.  
  816.                         case S_WITHDRAW:
  817.                                 stopScript();
  818.                                 ScreenshotUtil.takeScreenshot(isLoggedIn());
  819.                 }
  820.  
  821.                 return random(500, 1000);
  822.         }
  823.  
  824.         int antiBan() {
  825.                 int GambleInt = random(1, 6);
  826.                 switch (GambleInt) {
  827.                         case 1:
  828.                                 wait(random(2000, 2500));
  829.                                 break;
  830.                         case 2:
  831.                                 if (random(1, 4) == 1) {
  832.                                         int x = random(0, 750);
  833.                                         int y = random(0, 500);
  834.                                         moveMouse(0, 0, x, y);
  835.  
  836.                                 }
  837.                                 return random(1300, 1600);
  838.                         case 3:
  839.                                 // Is the current tab the inventory?
  840.                                 if (getCurrentTab() != TAB_INVENTORY) {
  841.                                         // No, so switch to the inventory tab.
  842.                                         openTab(TAB_INVENTORY);
  843.                                         return random(500, 750);
  844.                                 } else {
  845.                                         // No, so return
  846.                                         return random(500, 750);
  847.                                 }
  848.                         case 4:
  849.                                 // If the player is moving, then abort.
  850.                                 if (getMyPlayer().isMoving()) {
  851.                                         return random(750, 1000);
  852.                                 }
  853.  
  854.                                 if (System.currentTimeMillis() - lastCheck >= checkTime) {
  855.                                         lastCheck = System.currentTimeMillis();
  856.                                         checkTime = random(60000, 180000);
  857.  
  858.                                         if (getCurrentTab() != Constants.TAB_STATS) {
  859.                                                 openTab(Constants.TAB_STATS);
  860.                                         }
  861.                                         moveMouse(693, 273, 28, 10);
  862.                                         return random(2000, 4000);
  863.                                 }
  864.  
  865.  
  866.                         case 5:
  867.                                 if (random(1, 8) == 2) {
  868.                                         int angle = getCameraAngle() + random(-90, 90);
  869.                                         if (angle < 0) {
  870.                                                 angle = 0;
  871.                                         }
  872.                                         if (angle > 359) {
  873.                                                 angle = 0;
  874.  
  875.                                         }
  876.                                         setCameraRotation(angle);
  877.                                 }
  878.                                 return random(500, 750);
  879.                 }
  880.                 return random(500, 1000);
  881.         }
  882.  
  883.         public int useShopNPCKaramja() {
  884.                 RSNPC Shopkeeper = getNearestNPCByID(shopID);
  885.  
  886.                 if (getMyPlayer().isMoving())
  887.                         return random(250, 500);
  888.  
  889.                 if (runningFromCombat) {
  890.                         state = S_WALKTO_SPOT;
  891.                         return random(500, 750);
  892.                 }
  893.  
  894.                 if (RSInterface.getInterface(620).isValid()) {
  895.                         state = S_DEPOSIT;
  896.                         return 500;
  897.                 }
  898.  
  899.                 if (Shopkeeper != null) {
  900.                         if (atNPC(Shopkeeper, "trade")) {
  901.                                 log("Accessed shop.");
  902.                                 state = S_DEPOSIT;
  903.                                 currentFails = 0;
  904.                                 return random(500, 1000);
  905.                         } else {
  906.                                 log("Misclicked shopkeeper, trying again.");
  907.                                 currentFails++;
  908.                                 return random(500, 750);
  909.                         }
  910.                 }
  911.                 return random(500, 1000);
  912.         }
  913.      
  914.         public int useBankNPCShilo() {
  915.                 RSNPC banker = getNearestNPCByID(bankID);
  916.  
  917.                 if (getMyPlayer().isMoving())
  918.                         return random(250, 500);
  919.  
  920.                 if (runningFromCombat) {
  921.                         state = S_WALKTO_SPOT;
  922.                         return random(500, 750);
  923.                 }
  924.  
  925.                 if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  926.                         state = S_DEPOSIT;
  927.                         return 500;
  928.                 }
  929.  
  930.                 if (banker != null) {
  931.                         if (atNPC(banker, "bank banker")) {
  932.                                 log("Accessed bank account.");
  933.                                 state = S_DEPOSIT;
  934.                                 currentFails = 0;
  935.                                 return random(500, 1000);
  936.                         } else {
  937.                                 log("Misclicked bank, trying again.");
  938.                                 currentFails++;
  939.                                 return random(500, 750);
  940.                         }
  941.                 } else {
  942.                         log("Unable to find bankbooth");
  943.                         currentFails++;
  944.                         return random(500, 750);
  945.                 }
  946.  
  947.         }
  948.  
  949.  
  950.         public int useBankNPCPiscatoris() {
  951.                 RSNPC banker = getNearestNPCByID(bankID);
  952.  
  953.                 if (getMyPlayer().isMoving())
  954.                         return random(250, 500);
  955.  
  956.                 if (runningFromCombat) {
  957.                         state = S_WALKTO_SPOT;
  958.                         return random(500, 750);
  959.                 }
  960.  
  961.                 if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  962.                         state = S_DEPOSIT;
  963.                         return 500;
  964.                 }
  965.  
  966.                 if (banker != null) {
  967.                         if (atNPC(banker, "bank")) {
  968.                                 log("Accessed bank account.");
  969.                                 state = S_DEPOSIT;
  970.                                 currentFails = 0;
  971.                                 return random(500, 1000);
  972.                         } else {
  973.                                 log("Misclicked bank, trying again.");
  974.                                 currentFails++;
  975.                                 return random(500, 750);
  976.                         }
  977.                 } else {
  978.                         log("Unable to find bankbooth");
  979.                         currentFails++;
  980.                         return random(500, 750);
  981.                 }
  982.  
  983.         }
  984.  
  985.         public int useBankNPC() {
  986.                 RSNPC banker = getNearestNPCByID(bankID);
  987.  
  988.                 if (getMyPlayer().isMoving())
  989.                         return random(250, 500);
  990.  
  991.                 if (runningFromCombat) {
  992.                         state = S_WALKTO_SPOT;
  993.                         return random(500, 750);
  994.                 }
  995.  
  996.                 if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  997.                         state = S_DEPOSIT;
  998.                         return 500;
  999.                 }
  1000.  
  1001.                 if (banker != null) {
  1002.                         if (atNPC(banker, "bank banker")) {
  1003.                                 log("Accessed bank account.");
  1004.                                 state = S_DEPOSIT;
  1005.                                 currentFails = 0;
  1006.                                 return random(500, 1000);
  1007.                         } else {
  1008.                                 log("Misclicked bank, trying again.");
  1009.                                 currentFails++;
  1010.                                 return random(500, 750);
  1011.                         }
  1012.                 } else {
  1013.                         log("Unable to find bankbooth");
  1014.                         currentFails++;
  1015.                         return random(500, 750);
  1016.                 }
  1017.  
  1018.         }
  1019.  
  1020.         @SuppressWarnings("deprecation")
  1021.         public int useBank() {
  1022.                 RSObject bankBooth = findObject(bankID);
  1023.  
  1024.                 if (getMyPlayer().isMoving())
  1025.                         return random(250, 500);
  1026.  
  1027.                 if (runningFromCombat) {
  1028.                         state = S_WALKTO_SPOT;
  1029.                         return random(500, 750);
  1030.                 }
  1031.  
  1032.                 if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  1033.                         state = S_DEPOSIT;
  1034.                         return 500;
  1035.                 }
  1036.  
  1037.                 if (bankBooth != null) {
  1038.                         turnToObject(bankBooth, 40);
  1039.                         if (atObject(bankBooth, "Use-quickly")) {
  1040.                                 log("Accessed bank account.");
  1041.                                 state = S_DEPOSIT;
  1042.                                 currentFails = 0;
  1043.                                 return random(500, 1000);
  1044.                         } else {
  1045.                                 setCameraRotation(getCameraAngle() + random(-90, 90));
  1046.                                 log("Misclicked bank, trying again.");
  1047.                                 currentFails++;
  1048.                                 return random(500, 750);
  1049.                         }
  1050.                 } else {
  1051.                         log("Unable to find bankbooth");
  1052.                         currentFails++;
  1053.                         return random(500, 750);
  1054.                 }
  1055.         }
  1056.  
  1057.         public int walkToSpots() {
  1058.                 if (takeBoatToKaramja())
  1059.                         return random(2000, 2500);
  1060.  
  1061.                 if (randomRunEnergy <= getEnergy() && !isRunning()) {
  1062.                         setRun(true);
  1063.                         randomRunEnergy = random(20, 60);
  1064.                         return random(750, 1000);
  1065.                 }
  1066.  
  1067.                 if (distanceTo(toArea[toArea.length - 1]) <= 3) {
  1068.                         log("Arriving at fishing spots, continuing to fish.");
  1069.                         state = S_FISH;
  1070.                         currentFails = 0;
  1071.                         return random(250, 750);
  1072.                 }
  1073.                
  1074.  
  1075.                 if (!getMyPlayer().isMoving() || (getDestination() != null && distanceTo(getDestination()) < 10))
  1076.                         walkPathMM(randomizePath(toArea, 2, 2), 15);
  1077.                 return random(50, 150);
  1078.         }
  1079.                
  1080.  
  1081.         public int walkToBank() {
  1082.                 if (takeBoatFromKaramja())
  1083.                         return random(2000, 2500);
  1084.  
  1085.                 // TODO: bug fix.
  1086.                 /*if ( distanceTo(new RSTile(2953, 3147)) <= 4 )
  1087.                                         return random(250, 500);*/
  1088.  
  1089.                 if (randomRunEnergy <= getEnergy() && !isRunning()) {
  1090.                         setRun(true);
  1091.                         randomRunEnergy = random(20, 60);
  1092.                         return random(750, 1000);
  1093.                 }
  1094.  
  1095.                 if (runningFromCombat && !getMyPlayer().isInCombat()) {
  1096.                         log("No longer in combat, heading back to fishing spots.");
  1097.                         state = S_WALKTO_SPOT;
  1098.                         runningFromCombat = false;
  1099.                         return random(250, 750);
  1100.                 }
  1101.  
  1102.                 if (distanceTo(toBank[toBank.length - 1]) <= 4) {
  1103.  
  1104.                         log("Arriving at bank, Accessing account.");
  1105.                         state = S_USE_BANK;
  1106.                         return random(750, 1500);
  1107.                 }
  1108.  
  1109.                 if (!getMyPlayer().isMoving() || (getDestination() != null && distanceTo(getDestination()) < 10))
  1110.                         walkPathMM(randomizePath(toBank, 2, 2), 15);
  1111.  
  1112.                 return random(50, 150);
  1113.         }
  1114.          
  1115.         public int zombieWalkSpots() {
  1116.                 if (takeBoatToKaramja())
  1117.                         return random(2000, 2500);
  1118.  
  1119.                 if (randomRunEnergy <= getEnergy() && !isRunning()) {
  1120.                         setRun(true);
  1121.                         randomRunEnergy = random(20, 60);
  1122.                         return random(750, 1000);
  1123.                 }
  1124.  
  1125.                 if (distanceTo(toArea[toArea.length - 1]) <= 3) {
  1126.                         log("Arriving at fishing spots, continuing to fish.");
  1127.                         state = S_FISH;
  1128.                         currentFails = 0;
  1129.                         return random(250, 750);
  1130.                 }
  1131.  
  1132.               if (!getMyPlayer().isMoving() || (getDestination() != null && distanceTo(getDestination()) > 4))
  1133.                         walkPathMM(randomizePath(toArea, 2, 2), 15);
  1134.  
  1135.                 return random(50, 150);
  1136.         }
  1137.            
  1138.         public int zombieWalkBank() {
  1139.                 if (takeBoatFromKaramja())
  1140.                         return random(2000, 2500);
  1141.  
  1142.                 // TODO: bug fix.
  1143.                 /*if ( distanceTo(new RSTile(2953, 3147)) <= 4 )
  1144.                                         return random(250, 500);*/
  1145.  
  1146.                 if (randomRunEnergy <= getEnergy() && !isRunning()) {
  1147.                         setRun(true);
  1148.                         randomRunEnergy = random(20, 60);
  1149.                         return random(750, 1000);
  1150.                 }
  1151.  
  1152.                 if (runningFromCombat && !getMyPlayer().isInCombat()) {
  1153.                         log("No longer in combat, heading back to fishing spots.");
  1154.                         state = S_WALKTO_SPOT;
  1155.                         runningFromCombat = false;
  1156.                         return random(250, 750);
  1157.                 }
  1158.  
  1159.                 if (distanceTo(toBank[toBank.length - 1]) <= 4) {
  1160.  
  1161.                         log("Arriving at bank, Accessing account.");
  1162.                         state = S_USE_BANK;
  1163.                         return random(750, 1500);
  1164.                 }
  1165.  
  1166.             if (!getMyPlayer().isMoving() || (getDestination() != null && distanceTo(getDestination()) > 4))
  1167.                         walkPathMM(randomizePath(toBank, 2, 2), 15);
  1168.  
  1169.                 return random(50, 150);
  1170.         }
  1171.  
  1172.         public int dropAll() {
  1173.                 // Make an array of items to keep.
  1174.                 int[] thingsToKeep = new int[]{currentGear, currentBait, 995};
  1175.  
  1176.                 // Drop all, twice to make sure nothing is missed.
  1177.                 dropAllExcept(thingsToKeep);
  1178.                 dropAllExcept(thingsToKeep);
  1179.                 dropAllExcept(thingsToKeep);
  1180.                 dropAllExcept(thingsToKeep);
  1181.  
  1182.                 state = S_FISH;
  1183.  
  1184.                 return random(500, 750);
  1185.         }
  1186.  
  1187.         public int throwTunas() {
  1188.                 // Make an array of items to keep.
  1189.                 int[] thingsToKeep = new int[]{currentGear, currentBait, 995, 331, 335, 317, 321, 377, 371, 383, 14664, 7944, 363, 341, 353, 327, 345, 349};
  1190.  
  1191.                 // Drop all, twice to make sure nothing is missed.
  1192.                 dropAllExcept(thingsToKeep);
  1193.                 dropAllExcept(thingsToKeep);
  1194.                 dropAllExcept(thingsToKeep);
  1195.                 dropAllExcept(thingsToKeep);
  1196.  
  1197.                 state = S_FISH;
  1198.  
  1199.                 return random(500, 750);
  1200.         }
  1201.  
  1202.         public int tradeAllKaramja() {
  1203.                RSNPC stiles = getNearestNPCByID(11267);
  1204.                RSNPC fishingSpot = getNearestNPCByID(fishingSpotID);
  1205.  
  1206.                 if (getMyPlayer().isMoving())
  1207.                         return random(250, 500);
  1208.  
  1209.                 if (runningFromCombat) {
  1210.                         state = S_WALKTO_SPOT;
  1211.                         return random(500, 750);
  1212.                 }
  1213.  
  1214.  
  1215.                 if (stiles != null) {
  1216.                         if (atNPC(stiles, "exchange")) {
  1217.                                 wait(random(500, 2500));
  1218.                                 log("Clicked Stiles.");
  1219.                                 state = S_WALKTO_SPOT;
  1220.              
  1221.                               if (distanceTo(toArea[toArea.length - 1]) <= 3) {
  1222.                         log("Arriving at fishing spots, continuing to fish.");
  1223.                         state = S_FISH;
  1224.                         currentFails = 0;
  1225.                         return random(250, 750);
  1226.                 }
  1227.                                 currentFails = 0;
  1228.                                 return random(500, 1000);
  1229.                         } else {
  1230.                                 log("Misclicked stiles, trying again.");
  1231.                                 currentFails++;
  1232.                                 return random(500, 750);
  1233.                         }
  1234.                 } else {
  1235.                         log("Unable to find stiles");
  1236.                         currentFails++;
  1237.                         return random(500, 750);
  1238.                 }
  1239.  
  1240.         }
  1241.  
  1242.  
  1243.         public int depositAllKaramja() {
  1244.  
  1245.                 // Make an array of items to keep.
  1246.                 int[] thingsToKeep = new int[]{currentGear, currentBait, 995};
  1247.  
  1248.                 if (!RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  1249.                         state = S_USE_BANK;
  1250.                         return 500;
  1251.                 }
  1252.                 // Deposit all.
  1253.                 bank.depositAllExcept(thingsToKeep);
  1254.  
  1255.                 // Only switch states if thet deposit was successfull.
  1256.                 if (!isInventoryFull())
  1257.                         state = S_WALKTO_SPOT;
  1258.                 else
  1259.                         state = S_USE_BANK;
  1260.  
  1261.                 return random(500, 750);
  1262.         }
  1263.  
  1264.         public int depositAllRest() {
  1265.  
  1266.                 // Make an array of items to keep.
  1267.                 int[] thingsToKeep = new int[]{currentGear, currentBait};
  1268.  
  1269.                 if (!RSInterface.getInterface(INTERFACE_BANK).isValid()) {
  1270.                         state = S_USE_BANK;
  1271.                         return 500;
  1272.                 }
  1273.                 // Deposit all.
  1274.                 bank.depositAllExcept(thingsToKeep);
  1275.  
  1276.                 // Only switch states if thet deposit was successfull.
  1277.                 if (!isInventoryFull())
  1278.                         state = S_WALKTO_SPOT;
  1279.                 else
  1280.                         state = S_USE_BANK;
  1281.  
  1282.                 return random(500, 750);
  1283.         }
  1284.  
  1285.         public int stateFish() {
  1286.                 // Find fishing spot.
  1287.                 RSNPC fishingSpot = getNearestNPCByID(fishingSpotID);
  1288.                 //
  1289.                 if (currentBait != BAIT_NONE && getInventoryCount(currentBait) == 0) {
  1290.                         log.severe("No bait for current mode.");
  1291.                         log.severe("Please buy your feathers for the lowest price in the Grand Exchange.");
  1292.                         log.severe("I thank you for doing that, the current price for feathers is too high.");
  1293.                         log.severe("So, please help us out in the quest of bringing it down.");
  1294.  
  1295.                         currentFails += 5;
  1296.                         return random(250, 500);
  1297.                 }
  1298.  
  1299.                 //
  1300.                 if (checkAndRecoverGear())
  1301.                         return random(1000, 1500);
  1302.  
  1303.                 if (currentGear != GEAR_NONE && getInventoryCount(currentGear) == 0 && !barbarianMode) {
  1304.                         log("No gear for the current mode.");
  1305.                         currentFails += 5;
  1306.                         return random(250, 500);
  1307.                 }
  1308.  
  1309.                 // Is the player currently in combat?
  1310.                 if (getMyPlayer().isInCombat()) {
  1311.                         log("Running from combat.");
  1312.                         runningFromCombat = true;
  1313.                         state = S_WALKTO_BANK;
  1314.                         timesAvoidedCombat++;
  1315.                         return random(250, 500);
  1316.                 }
  1317.  
  1318.                 // Is the player's inventory full?
  1319.                 if (isInventoryFull()) {
  1320.                         openTab(TAB_INVENTORY);
  1321.                         log("The inventory is full, " + (powerFishing == true ? "dropping all catches." : "heading to the bank."));
  1322.                         state = (powerFishing == true) ? S_DROP_ALL : S_WALKTO_BANK;
  1323.                         return random(250, 500);
  1324.  
  1325.                 }
  1326.  
  1327.  
  1328.                 // Is the player current busy? If so, do antiban.
  1329.                 if (getMyPlayer().getAnimation() != -1 && !checkAndAvoidWhirlpools()
  1330.                                 || getMyPlayer().isMoving())
  1331.                         return antiBan();
  1332.  
  1333.  
  1334.                 if (fishingSpot == null) {
  1335.                         if (checkLostAndRecover())
  1336.                                 return random(500, 750);
  1337.                         if (distanceTo(toBank[toBank.length - 1]) <= 3) {
  1338.                                 state = S_WALKTO_SPOT;
  1339.                                 return random(750, 1500);
  1340.                         }
  1341.  
  1342.                         currentFails++;
  1343.                         log("Unable to find fishing spot.");
  1344.                         return random(250, 500);
  1345.                 } else {
  1346.                         if (tileOnScreen(fishingSpot.getLocation())) {
  1347.                                 if (!atNPC(fishingSpot, currentCommand)) setCameraRotation(random(1, 359));
  1348.                                 currentFails = 0;
  1349.                                 return random(2150, 2350);
  1350.                         } else {
  1351.                                 RSTile destination = randomizeTile(fishingSpot.getLocation(), 2, 2);
  1352.                                 walkTileMM(destination);
  1353.                                 return random(500, 1000);
  1354.                         }
  1355.                 }
  1356.         }
  1357.  
  1358.         public int stateTuna() {
  1359. // Find fishing spot.
  1360.                 RSNPC fishingSpot = getNearestNPCByID(fishingSpotID);
  1361.                 //
  1362.                 if (currentBait != BAIT_NONE && getInventoryCount(currentBait) == 0) {
  1363.                         log("No bait for current mode.");
  1364.                         log.severe("Please buy your feathers for the lowest price in the Grand Exchange.");
  1365.                         log.severe("I thank you for doing that, the current price for feathers is too high.");
  1366.                         log.severe("So, please help us out in the quest of bringing it down.");
  1367.  
  1368.                         currentFails += 5;
  1369.                         return random(250, 500);
  1370.                 }
  1371.  
  1372.                 //
  1373.                 if (checkAndRecoverGear())
  1374.                         return random(1000, 1500);
  1375.  
  1376.                 if (currentGear != GEAR_NONE && getInventoryCount(currentGear) == 0 && !barbarianMode) {
  1377.                         log("No gear for the current mode.");
  1378.                         currentFails += 5;
  1379.                         return random(250, 500);
  1380.                 }
  1381.  
  1382.                 // Is the player currently in combat?
  1383.                 if (getMyPlayer().isInCombat()) {
  1384.                         log("Running from combat.");
  1385.                         runningFromCombat = true;
  1386.                         state = S_WALKTO_BANK;
  1387.                         timesAvoidedCombat++;
  1388.                         return random(250, 500);
  1389.                 }
  1390.  
  1391.                 // Is the player's inventory full?
  1392.  
  1393.                 // Is the player's inventory full?
  1394.                 if (!isInventoryFull()) {
  1395.                         state = S_THROW_TUNAS;
  1396.                 } else {
  1397.                         state = S_WALKTO_BANK;
  1398.                         log("The inventory is full, dropping all Tunas.");
  1399.                         return random(250, 500);
  1400.                 }
  1401.  
  1402.  
  1403.                 // Is the player current busy? If so, do antiban.
  1404.                 if (getMyPlayer().getAnimation() != -1 && !checkAndAvoidWhirlpools()
  1405.                                 || getMyPlayer().isMoving())
  1406.                         return antiBan();
  1407.  
  1408.  
  1409.                 if (fishingSpot == null) {
  1410.                         if (checkLostAndRecover())
  1411.                                 return random(500, 750);
  1412.                         if (distanceTo(toBank[toBank.length - 1]) <= 3) {
  1413.                                 state = S_WALKTO_SPOT;
  1414.                                 return random(750, 1500);
  1415.                         }
  1416.  
  1417.                         currentFails++;
  1418.                         log("Unable to find fishing spot.");
  1419.                         return random(250, 500);
  1420.                 } else {
  1421.                         if (tileOnScreen(fishingSpot.getLocation())) {
  1422.                                 if (!atNPC(fishingSpot, currentCommand)) setCameraRotation(random(1, 359));
  1423.                                 currentFails = 0;
  1424.                                 return random(1500, 1700);
  1425.                         } else {
  1426.                                 RSTile destination = randomizeTile(fishingSpot.getLocation(), 2, 2);
  1427.                                 walkTileMM(destination);
  1428.                                 return random(500, 1000);
  1429.                         }
  1430.                 }
  1431.         }
  1432.  
  1433.  
  1434.         @SuppressWarnings("deprecation")
  1435.         public boolean hasEquipped(int GEAR_BARB) {
  1436.                 int[] equipItems = RSInterface.getInterface(387).getChild(29)
  1437.                                 .getInventory();
  1438.                 for (int j = 0; j < itemIDs.length; j++) {
  1439.                         for (int i = 0; i < equipItems.length; i++)
  1440.                                 if (i == j)
  1441.                                         return true;
  1442.                 }
  1443.                 return false;
  1444.         }
  1445.  
  1446.  
  1447.         public boolean checkAndAvoidWhirlpools() {
  1448.                 RSTile playerLocation = getMyPlayer().getLocation();
  1449.                 RSTile tileToTest1 = new RSTile(playerLocation.getX() + 1, playerLocation.getY());
  1450.                 RSTile tileToTest2 = new RSTile(playerLocation.getX() - 1, playerLocation.getY());
  1451.                 RSTile tileToTest3 = new RSTile(playerLocation.getX(), playerLocation.getY() + 1);
  1452.                 RSTile tileToTest4 = new RSTile(playerLocation.getX(), playerLocation.getY() - 1);
  1453.  
  1454.                 for (int id : whirlpools) {
  1455.                         RSNPC whirlpool = getNearestNPCByID(id);
  1456.  
  1457.                         if (whirlpool == null) continue;
  1458.  
  1459.                         if (whirlpool.getLocation().equals(tileToTest1) || whirlpool.getLocation().equals(tileToTest2) ||
  1460.                                         whirlpool.getLocation().equals(tileToTest3) || whirlpool.getLocation().equals(tileToTest4)) {
  1461.                                 whirlpoolsAvoided++;
  1462.                                 log("Found whirlpool");
  1463.                                 return true;
  1464.                         }
  1465.                 }
  1466.  
  1467.                 return false;
  1468.         }
  1469.  
  1470.  
  1471.         public boolean checkLostAndRecover() {
  1472.                 int index = 0;
  1473.                 for (RSTile lost : lostTiles) {
  1474.                         if (distanceTo(lost) <= 2) {
  1475.                                 RSTile destination = randomizeTile(recoverTiles[index], 2, 2);
  1476.                                 log("Lost at " + lost.getX() + ", " + lost.getY() + ", recovering.");
  1477.                                 walkTileMM(destination);
  1478.                                 return true;
  1479.                         }
  1480.  
  1481.                         index++;
  1482.                 }
  1483.  
  1484.                 return false;
  1485.  
  1486.         }
  1487.  
  1488.  
  1489.         public boolean checkAndRecoverGear() {
  1490.                 RSItemTile itemTile = getGroundItemByID(currentGear);
  1491.  
  1492.                 if (barbarianMode) return false;
  1493.  
  1494.                 if (getInventoryCount(currentGear) == 0 && itemTile != null) {
  1495.                         if (tileOnScreen(itemTile)) {
  1496.                                 timesRecoveredGear++;
  1497.                                 log("Recovered gear.");
  1498.                                 atTile(itemTile, "Take");
  1499.                                 return true;
  1500.                         } else {
  1501.                                 log("Walking to gear location.");
  1502.                                 walkTileMM(itemTile);
  1503.                                 return true;
  1504.                         }
  1505.                 } else {
  1506.                         return false;
  1507.                 }
  1508.         }
  1509.  
  1510.  
  1511.         @SuppressWarnings("deprecation")
  1512.         public boolean takeBoatFromKaramja() {
  1513.                 RSNPC customsOfficer = getNearestNPCByID(380);
  1514.                 @SuppressWarnings("unused")
  1515.                 RSObject plank = findObject(242);
  1516.                 RSTile location = new RSTile(3031, 3217);
  1517.  
  1518.  
  1519.                 if (!locationName.equals("Karamja"))
  1520.                         return false;
  1521.  
  1522.                 if (getInventoryCount(995) < 30) {
  1523.                         log("Not enough GP for a boat ride.");
  1524.                 }
  1525.  
  1526.                 if (distanceTo(location) <= 20 && !getMyPlayer().getLocation().equals(new RSTile(3029, 3217))) {
  1527.                         if (tileOnScreen(location)) {
  1528.                                 atTile(location, "Cross");
  1529.                                 log("Arriving at Port Sarim.");
  1530.                                 return true;
  1531.                         }
  1532.  
  1533.  
  1534.                 }
  1535.  
  1536.                 if (RSInterface.getInterface(228).isValid()) {
  1537.                         atInterface(RSInterface.getInterface(228).getChild(2));
  1538.                         return true;
  1539.                 }
  1540.                 if (RSInterface.getInterface(242).isValid()) {
  1541.                         atInterface(RSInterface.getInterface(242).getChild(6));
  1542.                         return true;
  1543.                 }
  1544.  
  1545.                 if (RSInterface.getInterface(230).isValid()) {
  1546.                         atInterface(RSInterface.getInterface(230).getChild(3));
  1547.                         return true;
  1548.                 }
  1549.  
  1550.                 if (RSInterface.getInterface(241).isValid()) {
  1551.                         atInterface(RSInterface.getInterface(241).getChild(5));
  1552.                         return true;
  1553.                 }
  1554.  
  1555.                 if (RSInterface.getInterface(64).isValid()) {
  1556.                         atInterface(RSInterface.getInterface(64).getChild(5));
  1557.                         return true;
  1558.                 }
  1559.  
  1560.                 if (RSInterface.getInterface(228).isValid()) {
  1561.                         atInterface(RSInterface.getInterface(228).getChild(2));
  1562.                         return false;
  1563.                 }
  1564.  
  1565.                 if (RSInterface.getInterface(241).isValid()) {
  1566.                         atInterface(RSInterface.getInterface(241).getChild(5));
  1567.                         return false;
  1568.                 }
  1569.  
  1570.                 if (customsOfficer != null) {
  1571.                         if (tileOnScreen(customsOfficer.getLocation())) {
  1572.                                 atNPC(customsOfficer, "Pay-Fare");
  1573.                                 return true;
  1574.                         } else {
  1575.                                 walkTileMM(randomizeTile(customsOfficer.getLocation(), 2, 2));
  1576.                                 return true;
  1577.                         }
  1578.  
  1579.                 }
  1580.  
  1581.                 return false;
  1582.         }
  1583.  
  1584.         @SuppressWarnings("deprecation")
  1585.         public boolean takeBoatToKaramja() {
  1586.                 int[] seamanIDs = new int[]{376, 377, 378}; // Pay-fare
  1587.                 RSNPC seaman = getNearestNPCByID(seamanIDs);
  1588.                 RSObject plank = findObject(2082);
  1589.  
  1590.                 if (!locationName.equals("Karamja"))
  1591.                         return false;
  1592.  
  1593.                 if (getInventoryCount(995) < 30) {
  1594.                         log("Not enough GP for a boat ride.");
  1595.                 }
  1596.  
  1597.                 if (plank != null) {
  1598.                         log("Arriving at Karamja.");
  1599.                         atObject(plank, "Cross");
  1600.                         return true;
  1601.                 }
  1602.  
  1603.                 if (RSInterface.getInterface(64).isValid()) {
  1604.                         atInterface(RSInterface.getInterface(64).getChild(5));
  1605.                         return true;
  1606.                 }
  1607.  
  1608.                 if (RSInterface.getInterface(228).isValid()) {
  1609.                         atInterface(RSInterface.getInterface(228).getChild(2));
  1610.                         return true;
  1611.                 }
  1612.  
  1613.                 if (RSInterface.getInterface(241).isValid()) {
  1614.                         atInterface(RSInterface.getInterface(241).getChild(5));
  1615.                         return true;
  1616.                 }
  1617.                 if (seaman != null) {
  1618.                         if (tileOnScreen(seaman.getLocation())) {
  1619.                                 atNPC(seaman, "Pay-fare");
  1620.                                 return true;
  1621.                         } else {
  1622.                                 walkTileMM(randomizeTile(seaman.getLocation(), 2, 2));
  1623.                                 return true;
  1624.                         }
  1625.                 }
  1626.  
  1627.                 return false;
  1628.         }
  1629.  
  1630.         public boolean checkForLogout() {
  1631.                 for (int failed = 0; failed < 3; failed++) {
  1632.                         logout();
  1633.                         beep(3);
  1634.                         wait(500);
  1635.                         if (!isLoggedIn()) {
  1636.                                 return true;
  1637.                         }
  1638.                 }
  1639.                 return false;
  1640.         }
  1641.  
  1642.  
  1643.         public void onRepaint(Graphics g) {
  1644.  
  1645.                 long runTime = 0;
  1646.                 long seconds = 0;
  1647.                 long minutes = 0;
  1648.                 long hours = 0;
  1649.                 int index = Skills.getStatIndex("Fishing");
  1650.                 @SuppressWarnings("unused")
  1651.                 long untilhour = 0, untilmin = 0, untilsec = 0;
  1652.                 int exp = 0;
  1653.                 int expGained = 0;
  1654.                 int levelsGained;
  1655.  
  1656.                 //
  1657.                 if (lastExp == 0)
  1658.                         lastExp = skills.getCurrentSkillExp(STAT_FISHING);
  1659.  
  1660.                 if (skills.getCurrentSkillExp(STAT_FISHING) > lastExp) {
  1661.                         lastExp = skills.getCurrentSkillExp(STAT_FISHING);
  1662.                         numberOfCatches++;
  1663.                 }
  1664.  
  1665.                 if (countToNext == 0) {
  1666.                         untilsec = 0;
  1667.                         untilhour = 0;
  1668.                         untilmin = 0;
  1669.                 }
  1670.  
  1671.                 // Return if paint is disabled.
  1672.                 if (!usePaint) return;
  1673.  
  1674.                 //
  1675.                 if (playerStartXP == 0)
  1676.                         playerStartXP = skills.getCurrentSkillExp(STAT_FISHING);
  1677.  
  1678.                 if (startLevel == 0)
  1679.                         startLevel = skills.getCurrentSkillLevel(STAT_FISHING);
  1680.  
  1681.                 // Calculate current runtime.
  1682.                 runTime = System.currentTimeMillis() - scriptStartTime;
  1683.                 seconds = runTime / 1000;
  1684.                 if (seconds >= 60) {
  1685.                         minutes = seconds / 60;
  1686.                         seconds -= (minutes * 60);
  1687.                 }
  1688.                 if (minutes >= 60) {
  1689.                         hours = minutes / 60;
  1690.                         minutes -= (hours * 60);
  1691.                 }
  1692.                 exp = skills.getCurrentSkillExp(index) - startExp;
  1693.                 if (exp > oldExp) {
  1694.                         xpPerCatch = exp - oldExp;
  1695.                         oldExp = exp;
  1696.                         catches++;
  1697.                         countToNext = skills.getXPToNextLevel(STAT_FISHING) / xpPerCatch
  1698.                                         + 1;
  1699.                 }
  1700.  
  1701.  
  1702.                 // Calculate experience gained.
  1703.                 expGained = skills.getCurrentSkillExp(STAT_FISHING) - playerStartXP;
  1704.                 if (pColor.equals("SunKist")) {
  1705.                         g.setColor(new Color(253, 196, 0, 100));
  1706.                 }
  1707.                 if (pColor.equals("PinkPanther")) {
  1708.                         g.setColor(new Color(255, 100, 255, 53));
  1709.                 }
  1710.                 if (pColor.equals("ClearSky")) {
  1711.                         g.setColor(new Color(60, 155, 159, 50));
  1712.                 }
  1713.                 if (pColor.equals("Monochrome")) {
  1714.                         g.setColor(new Color(0, 0, 0, 175));
  1715.                 }
  1716.                 if (pColor.equals("BloodShed")) {
  1717.                         g.setColor(new Color(255, 0, 0, 50));
  1718.                 }
  1719.                 if (pColor.equals("Nightmare")) {
  1720.                         g.setColor(new Color(0, 0, 0, 175));
  1721.                 }
  1722.  
  1723.                 int[][] paint = new int[][]{new int[]{136, 152, 168, 184, 200, 216, 232, 248, 264, 280, 296, 312, 328}, new int[]{152, 186}};
  1724.                 if (barbarianMode) {
  1725.                         paint[1][0] -= 16;
  1726.                         paint[1][1] += 16;
  1727.                 }
  1728.                 if (powerFishing) {
  1729.                         paint[1][0] -= 16;
  1730.                         paint[1][1] += 16;
  1731.                 }
  1732.                 g.fillRoundRect(4, paint[1][0], 200, paint[1][1], 45, 45);
  1733.  
  1734.                 // Calculate levels gained
  1735.                 levelsGained = skills.getCurrentSkillLevel(STAT_FISHING) - startLevel;
  1736.                 if (pColor.equals("SunKist")) {
  1737.                         g.setColor(Color.WHITE);
  1738.                 }
  1739.                 if (pColor.equals("PinkPanther")) {
  1740.                         g.setColor(Color.BLACK);
  1741.                 }
  1742.                 if (pColor.equals("ClearSky")) {
  1743.                         g.setColor(Color.BLACK);
  1744.                 }
  1745.                 if (pColor.equals("Monochrome")) {
  1746.                         g.setColor(Color.WHITE);
  1747.                 }
  1748.                 if (pColor.equals("BloodShed")) {
  1749.                         g.setColor(Color.BLACK);
  1750.                 }
  1751.                 if (pColor.equals("Nightmare")) {
  1752.                         g.setColor(Color.GREEN);
  1753.                 }
  1754.                 final ScriptManifest props = getClass().getAnnotation(
  1755.                                 ScriptManifest.class);
  1756.                 if (barbarianMode || powerFishing) {
  1757.                         if (powerFishing && !barbarianMode) {
  1758.                                 g.drawString(props.name() + " v" + props.version(), 12, paint[0][1]);
  1759.                                 g.drawString("Fishing location: " + locationName, 12, paint[0][2]);
  1760.                                 g.drawString("Fishing for: " + catchName, 12, paint[0][3]);
  1761.                                 g.drawString("Powerfishing Mode Active", 12, paint[0][4]);
  1762.                                 g.drawString("Run time: " + hours + ":" + minutes + ":" + seconds, 12, paint[0][5]);
  1763.                                 g.drawString("Catches: " + numberOfCatches, 12, paint[0][6]);
  1764.                                 g.drawString("Catches to next level: " + countToNext, 12, paint[0][7]);
  1765.                                 g.drawString("XP Gained: " + expGained, 12, paint[0][8]);
  1766.                                 g.drawString("Levels Gained: " + levelsGained, 12, paint[0][9]);
  1767.                                 g.drawString("Percent to next level: " + skills.getPercentToNextLevel(STAT_FISHING), 12, paint[0][10]);
  1768.                                 g.drawString("Times Avoided Combat: " + timesAvoidedCombat, 12, paint[0][11]);
  1769.  
  1770.                         }
  1771.                         if (!powerFishing && barbarianMode) {
  1772.                                 g.drawString(props.name() + " v" + props.version(), 12, paint[0][1]);
  1773.                                 g.drawString("Fishing location: " + locationName, 12, paint[0][2]);
  1774.                                 g.drawString("Fishing for: " + catchName, 12, paint[0][3]);
  1775.                                 g.drawString("Barbarian Mode Active", 12, paint[0][4]);
  1776.                                 g.drawString("Run time: " + hours + ":" + minutes + ":" + seconds, 12, paint[0][5]);
  1777.                                 g.drawString("Catches: " + numberOfCatches, 12, paint[0][6]);
  1778.                                 g.drawString("Catches to next level: " + countToNext, 12, paint[0][7]);
  1779.                                 g.drawString("XP Gained: " + expGained, 12, paint[0][8]);
  1780.                                 g.drawString("Levels Gained: " + levelsGained, 12, paint[0][9]);
  1781.                                 g.drawString("Percent to next level: " + skills.getPercentToNextLevel(STAT_FISHING), 12, paint[0][10]);
  1782.                                 g.drawString("Times Avoided Combat: " + timesAvoidedCombat, 12, paint[0][11]);
  1783.  
  1784.                         }
  1785.                         if (powerFishing && barbarianMode) {
  1786.                                 g.drawString(props.name() + " v" + props.version(), 12, paint[0][0]);
  1787.                                 g.drawString("Fishing location: " + locationName, 12, paint[0][1]);
  1788.                                 g.drawString("Fishing for: " + catchName, 12, paint[0][2]);
  1789.                                 g.drawString("Powerfishing Mode Active", 12, paint[0][3]);
  1790.                                 g.drawString("Barbarian Mode Active", 12, paint[0][4]);
  1791.                                 g.drawString("Run time: " + hours + ":" + minutes + ":" + seconds, 12, paint[0][5]);
  1792.                                 g.drawString("Catches: " + numberOfCatches, 12, paint[0][6]);
  1793.                                 g.drawString("Catches to next level: " + countToNext, 12, paint[0][7]);
  1794.                                 g.drawString("XP Gained: " + expGained, 12, paint[0][8]);
  1795.                                 g.drawString("Levels Gained: " + levelsGained, 12, paint[0][9]);
  1796.                                 g.drawString("Percent to next level: " + skills.getPercentToNextLevel(STAT_FISHING), 12, paint[0][10]);
  1797.                                 g.drawString("Times Avoided Combat: " + timesAvoidedCombat, 12, paint[0][11]);
  1798.  
  1799.                         }
  1800.                 } else {
  1801.                         g.drawString(props.name() + " v" + props.version(), 12, paint[0][2]);
  1802.                         g.drawString("Fishing location: " + locationName, 12, paint[0][3]);
  1803.                         g.drawString("Fishing for: " + catchName, 12, paint[0][4]);
  1804.                         g.drawString("Run time: " + hours + ":" + minutes + ":" + seconds, 12, paint[0][5]);
  1805.                         g.drawString("Catches: " + numberOfCatches, 12, paint[0][6]);
  1806.                         g.drawString("Catches to next level: " + countToNext, 12, paint[0][7]);
  1807.                         g.drawString("XP Gained: " + expGained, 12, paint[0][8]);
  1808.                         g.drawString("Levels Gained: " + levelsGained, 12, paint[0][9]);
  1809.                         g.drawString("Percent to next level: " + skills.getPercentToNextLevel(STAT_FISHING), 12, paint[0][10]);
  1810.                         g.drawString("Times Avoided Combat: " + timesAvoidedCombat, 12, paint[0][11]);
  1811.  
  1812.                 }
  1813.         }
  1814.  
  1815.  
  1816.         public boolean clickcontinue() {
  1817.                 if (getContinueChildInterface() != null) {
  1818.                         if (getContinueChildInterface().getText().contains("to continue")) {
  1819.                                 return atInterface(getContinueChildInterface());
  1820.                         }
  1821.                 }
  1822.                 return false;
  1823.         }
  1824.  
  1825.         public void beep(int count) {
  1826.                 if (!Sound) return;
  1827.                 for (int i = 0; i < count; i++) {
  1828.                         java.awt.Toolkit.getDefaultToolkit().beep();
  1829.                         wait(250);
  1830.                 }
  1831.                 wait(random(100, 500));
  1832.                 return;
  1833.         }
  1834.  
  1835.  
  1836.         public boolean isWelcomeButton() {
  1837.                 RSInterface welcomeInterface = RSInterface.getInterface(378);
  1838.                 if (welcomeInterface.getChild(45).getAbsoluteX() > 20 || (!welcomeInterface.getChild(117).getText().equals("10.1120.190") && !welcomeInterface.getChild(117).getText().equals(""))) {
  1839.                         log("We still are in Welcome Screen");
  1840.                         return true;
  1841.                 } else {
  1842.                         return false;
  1843.                 }
  1844.         }
  1845.  
  1846.  
  1847.         public void serverMessageRecieved(ServerMessageEvent arg0) {
  1848.                 String serverString = arg0.getMessage();
  1849.                 if (serverString.contains("You've just advanced")) {
  1850.                         log.severe("Another lvl by ZombieFisher");
  1851.                         beep(1);
  1852.                         clickcontinue();
  1853.                 }
  1854.                 if (serverString.contains("Oh dear")) {
  1855.                         log.severe("Oh crap u were killed");
  1856.                         beep(5);
  1857.                 }
  1858.         }
  1859. }