Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ---- Made by Himekp ----
- * The Current Version is V1.31
- */
- import org.powerbot.concurrent.Task;
- import org.powerbot.concurrent.strategy.Condition;
- import org.powerbot.concurrent.strategy.Strategy;
- import org.powerbot.game.api.ActiveScript;
- import org.powerbot.game.api.Manifest;
- import org.powerbot.game.api.util.Filter;
- import org.powerbot.game.api.util.Time;
- import org.powerbot.game.api.util.Random;
- import org.powerbot.game.api.util.Timer;
- import org.powerbot.game.api.methods.interactive.Players;
- import org.powerbot.game.api.methods.interactive.NPCs;
- import org.powerbot.game.api.methods.widget.Camera;
- import org.powerbot.game.api.methods.input.Mouse;
- import org.powerbot.game.api.methods.tab.Inventory;
- import org.powerbot.game.api.methods.Walking;
- import org.powerbot.game.api.methods.tab.Skills;
- import org.powerbot.game.api.methods.Tabs;
- import org.powerbot.game.api.wrappers.interactive.NPC;
- import org.powerbot.game.api.wrappers.node.Item;
- import org.powerbot.game.api.wrappers.Area;
- import org.powerbot.game.api.wrappers.Tile;
- import org.powerbot.game.bot.event.MessageEvent;
- import org.powerbot.game.bot.event.listener.MessageListener;
- import org.powerbot.game.bot.event.listener.PaintListener;
- import org.powerbot.game.api.methods.node.SceneEntities;
- import org.powerbot.game.api.methods.widget.Bank;
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.io.IOException;
- import java.net.URL;
- import javax.imageio.ImageIO;
- import javax.swing.*;
- @Manifest(
- name = "{AIO}ProFisher by Himekp{AIO} V1.31",
- description = "Fish's anything and everywhere!",
- version = 1.31,
- authors = {"Himekp"}, premium = false,
- website = "https://www.powerbot.org/community/topic/678005-aioprofisher-by-himekpaio/")
- public class ProFisher extends ActiveScript implements PaintListener, MessageListener{
- //Ints
- int FEATHERS = 314;
- int pathtype;
- //Ints[]
- int[] sharks = { 322, 313 };
- int[] tuna = { 321, 312, 324 };
- int[] trout = { 317, 328 };
- int[] shrimp = { 320, 327, 323 };
- int[] monk = { 3848, 3848 };
- int[] fishingspots = { 322, 313, 321, 312, 324, 317, 328, 320, 327, 323, 3848, 3848 };
- int[] fishingAnim = { 622, 623, 621, 619, 618, 620, 5108, 9980, 6708, 14723, 6711, 10617 };
- int[] bankers = { 2213, 49018, 2012, 2019, 2015, 26972 };
- int[] NPCBanker = { 11267, 499, 3824 };
- int[] FISH_SPOT;
- //Stings
- String status = "";
- String FISH_TYPE = "";
- String TypeofFish = "";
- String Location = "";
- String Banking = "";
- String type = "";
- String statusmessage = "";
- String method = "";
- //Booleans
- boolean BANK = true;
- boolean NPCBankers = false;
- boolean atBankSpot;
- boolean atFishingSpot;
- boolean atFishingSpot2;
- boolean atFishingSpot3;
- //Paths
- Tile BankTile;
- Tile FishTile;
- //Paint Ints
- int startLevel;
- int XPgained;
- int XPhour;
- int FishCaught = 0;
- int levelsgained = 0;
- int mouseSpeed;
- int EXPgained = 0;
- int EXPperhour = 0;
- int MoneyGained = 0;
- int FishCaughtperhour = 0;
- int loadsCaught = 0;
- int timetilllevel = 0;
- int currentLevel = 0;
- long startTime = System.currentTimeMillis();
- long currentXP;
- long startingXP;
- //GUI Stuff
- JFrame gui = new ProFisherGUI();
- //Filters
- private final Filter<NPC> FishFilter = new Filter<NPC>() {
- public boolean accept(NPC npc) {
- for (int id : FISH_SPOT) {
- if (npc.getId() == id) {
- return true;
- }
- }
- return false;
- }
- };
- //Areas
- public boolean atdraynorBank() {
- Area area = new Area(new Tile(3090,3239, 0), new Tile(3095, 3246, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atguildBank() {
- Area area = new Area(new Tile(2583, 3419, 0), new Tile(2588, 3425, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atkaramjaBank() {
- Area area = new Area(new Tile(2848, 3141, 0), new Tile(2853, 3146, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atbarbBank() {
- Area area = new Area(new Tile(3091, 3487, 0), new Tile(3099, 3498, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atcatherbyBank() {
- Area area = new Area(new Tile(2805, 3437, 0), new Tile(2816, 3443, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atcolonyBank() {
- Area area = new Area(new Tile(2326,3685, 0), new Tile(2331, 3692, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atshiloBank() {
- Area area = new Area(new Tile(2849, 2951, 0), new Tile(2856, 2958, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atDraynor() {
- Area area = new Area(new Tile(3083,3223, 0), new Tile(3087, 3235, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atGuild() {
- Area area = new Area(new Tile(2595,3405, 0), new Tile(2621, 3445, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atColony() {
- Area area = new Area(new Tile(2300,3695, 0), new Tile(2355, 3711, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atMonk1() {
- Area area = new Area(new Tile(2340,3687, 0), new Tile(2355, 3711, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atMonk2() {
- Area area = new Area(new Tile(2321,3687, 0), new Tile(2339, 3711, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atMonk3() {
- Area area = new Area(new Tile(2300,3687, 0), new Tile(2319, 3711, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atShilo1() {
- Area area = new Area(new Tile(2838,2948, 0), new Tile(2878, 2984, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atShilo2() {
- Area area = new Area(new Tile(2817,2948, 0), new Tile(2837, 2977, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atFishing1() {
- Area area = new Area(new Tile(2592,3419, 0), new Tile(2604, 3425, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atFishing2() {
- Area area = new Area(new Tile(2590,3405, 0), new Tile(2611, 3424, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atKaramja() {
- Area area = new Area(new Tile(2917,3172, 0), new Tile(2928, 3183, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atBarb() {
- Area area = new Area(new Tile(3100,3422, 0), new Tile(3109, 3434, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atCatherby() {
- Area area = new Area(new Tile(2833, 3414, 0), new Tile(2863, 3440, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- public boolean atShilo() {
- Area area = new Area(new Tile(2817, 2966, 0), new Tile(2868, 2983, 0));
- return area.contains(Players.getLocal().getLocation());
- }
- //Path Tiles
- Tile gotocolonybank = new Tile(2330, 3689, 0);
- Tile gotodraynorbank = new Tile(3092, 3242, 0);
- Tile gotoguildbank = new Tile(2585, 3422, 0);
- Tile gotokaramjabank = new Tile(2852, 3143, 0);
- Tile gotobarbbank = new Tile(3092, 3490, 0);
- Tile gotocatherbybank = new Tile(2809, 3441, 0);
- Tile gotoshilobank = new Tile(2851, 2956, 0);
- Tile gotocolony = new Tile(2336, 3699, 0);
- Tile gotodraynor = new Tile(3086, 3232, 0);
- Tile gotoguild = new Tile(2600, 3421, 0);
- Tile gotokaramja = new Tile(2924, 3176, 0);
- Tile gotobarb = new Tile(3108, 3433, 0);
- Tile gotocatherby = new Tile(2839, 3435, 0);
- Tile gotoshilo = new Tile(2855, 2971, 0);
- //Setup
- @Override protected void setup() {
- log.info("Welcome to Himekp's AIO ProFisher! V1.31!");
- log.info("Please post how the walking goes!!");
- startingXP = Skills.getExperience(Skills.FISHING);
- gui.setVisible(true);
- final Working working = new Working();
- final Fish fish = new Fish();
- final WalkBank walkbank = new WalkBank();
- final BankItems bankitems = new BankItems();
- final WalkSpot walkspot = new WalkSpot();
- final Drop drop = new Drop();
- final BankNPCBankers banknpcbankers = new BankNPCBankers();
- provide(new Strategy(working, working));
- provide(new Strategy(fish, fish));
- provide(new Strategy(walkbank, walkbank));
- provide(new Strategy(bankitems, bankitems));
- provide(new Strategy(walkspot, walkspot));
- provide(new Strategy(drop, drop));
- provide(new Strategy(banknpcbankers, banknpcbankers));
- }
- //Script!
- private class WalkBank extends Strategy implements Task, Condition {
- public boolean validate() {
- return Inventory.getCount() == 28 && !atBankSpot && BANK == true;
- }
- public void run() {
- status = "Walking to Bank!";
- Walking.walk(BankTile);
- }
- }
- private class WalkSpot extends Strategy implements Task {
- public boolean validate() {
- return Inventory.getCount() < 28 && (!atFishingSpot || !atFishingSpot2 || !atFishingSpot3) && BANK == true;
- }
- public void run() {
- status = "Walking to Fishing Spot!";
- Walking.walk(FishTile);
- }
- }
- private class Fish extends Strategy implements Task, Condition {
- public boolean validate() {
- return Inventory.getCount() != 28 && Players.getLocal().getAnimation() == -1 && (atFishingSpot || atFishingSpot2 || atFishingSpot3);
- }
- public void run() {
- Tabs.INVENTORY.open();
- status = "Fishing";
- NPC FishSpot = NPCs.getNearest(FishFilter);
- if (!FishSpot.isOnScreen()) {
- Camera.turnTo(FishSpot);
- }
- if (FishSpot.getLocation().interact(FISH_TYPE)) {
- Time.sleep(5000);
- }
- Time.sleep(Random.nextInt(100, 300));
- }
- }
- private class BankNPCBankers extends Strategy implements Task, Condition {
- public boolean validate() {
- return Inventory.getCount() == 28 && atBankSpot && NPCBankers == true;
- }
- public void run() {
- NPC NPCbanker = NPCs.getNearest(NPCBanker);
- status = type + "with" + statusmessage + "!";
- if (NPCbanker.isOnScreen()) {
- NPCbanker.interact(method);
- Time.sleep(Random.nextInt(1000, 2000));
- loadsCaught +=1;
- if (Location.equals("Shilo Village") || Location.equals("Fishing Colony")) {
- if(Bank.isOpen()) {
- Bank.depositInventory();
- Bank.close();
- }
- }
- }
- else if (!NPCbanker.isOnScreen()) {
- final Tile path = NPCbanker.getLocation();
- if (Walking.walk(path)){
- Time.sleep(50);
- }
- }
- }
- }
- private class Drop extends Strategy implements Task, Condition {
- public boolean validate() {
- return Inventory.getCount() == 28 && BANK == false && NPCBankers == false;
- }
- public void run() {
- status = "Dropping Items";
- Item[] items = Inventory.getItems();
- for(Item i : items) {
- if(i != null) {
- if(i.getId() == FEATHERS) {
- i.getWidgetChild().interact("Drop");
- Time.sleep(Random.nextInt(75, 150));
- loadsCaught +=1;
- }
- }
- }
- }
- }
- private class BankItems extends Strategy implements Task, Condition {
- public boolean validate() {
- return Inventory.getCount() == 28 && atBankSpot && BANK == true && NPCBankers == false;
- }
- public void run() {
- status = "Banking";
- if (SceneEntities.getNearest(bankers).isOnScreen()) {
- if(Bank.isOpen()) {
- Bank.depositInventory();
- Bank.close();
- } else {
- Bank.open();
- Time.sleep(2000);
- }
- }
- else if (!SceneEntities.getNearest(bankers).isOnScreen()) {
- final Tile path = SceneEntities.getNearest(bankers).getLocation();
- if (Walking.walk(path)){
- Time.sleep(50);
- }
- }
- }
- }
- private class Working extends Strategy implements Task, Condition {
- public boolean validate() {
- return Players.getLocal().getAnimation() != -1;
- }
- public void run() {
- for (int i : fishingAnim) {
- final Timer wTimer = new Timer(3000);
- while (Players.getLocal().getAnimation() == i || wTimer.getRemaining() != 0) {
- int randomNumber = Random.nextInt(1, 633);
- if (randomNumber <= 20) {
- status = "Antiban";
- Time.sleep(Random.nextInt(500, 800));
- if (randomNumber == 1) {
- randomTab();
- }
- if (randomNumber == 2) {
- Camera.setPitch(Random.nextInt(0, 180));
- Time.sleep(Random.nextInt(500, 1300));
- }
- if (randomNumber == 3) {
- Time.sleep(Random.nextInt(100, 200));
- Mouse.move(Random.nextInt(50, 700), Random.nextInt(50, 450), 2, 2);
- Camera.setAngle(Random.nextInt(1, 360));
- Mouse.move(Random.nextInt(50, 700), Random.nextInt(50, 450), 2, 2);
- }
- if (randomNumber == 4) {
- Players.getLocal().hover();
- }
- if (randomNumber == 5) {
- Time.sleep(Random.nextInt(700, 14000));
- }
- if (randomNumber == 6) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(500, 1300));
- }
- if (randomNumber == 7) {
- Time.sleep(Random.nextInt(800, 13500));
- }
- if (randomNumber == 8) {
- Mouse.move(163, 111, 150, 150);
- }
- if (randomNumber == 9) {
- Mouse.move(163, 111, 150, 150);
- }
- if (randomNumber == 10) {
- Mouse.move(702, 280, 23, 12);
- Time.sleep(Random.nextInt(1300, 5000));
- }
- if (randomNumber == 11) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(450, 650));
- }
- if (randomNumber == 12) {
- Players.getLocal().hover();
- }
- if (randomNumber == 13) {
- Time.sleep(Random.nextInt(100, 200));
- Mouse.move(Random.nextInt(50, 700), Random.nextInt(50, 450), 2, 2);
- Camera.setPitch(Random.nextInt(1, 180));
- Mouse.move(Random.nextInt(50, 700), Random.nextInt(50, 450), 2, 2);
- }
- if (randomNumber == 14) {
- Time.sleep(Random.nextInt(100, 200));
- Mouse.move(Random.nextInt(50, 700), Random.nextInt(50, 450), 2, 2);
- Camera.setAngle(Random.nextInt(1, 360));
- Mouse.move(Random.nextInt(50, 700), Random.nextInt(50, 450), 2, 2);
- }
- if (randomNumber == 15) {
- Time.sleep(Random.nextInt(700, 14000));
- }
- if (randomNumber == 16) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(450, 650));
- }
- if (randomNumber == 17) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(450, 650));
- }
- if (randomNumber == 18) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(450, 650));
- }
- if (randomNumber == 19) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(450, 650));
- }
- if (randomNumber == 20) {
- Camera.setAngle(Random.nextInt(0, 360));
- Time.sleep(Random.nextInt(450, 650));
- }
- }
- if (Tabs.getCurrent() != Tabs.INVENTORY) {
- Tabs.INVENTORY.open();
- }
- if(Inventory.getItem().getId() == 24154 || Inventory.getItem().getId() == 24155) {
- Inventory.getItem().getWidgetChild().click(true);
- }
- }
- }
- }
- public void randomTab() {
- int randomNumber = Random.nextInt(1, 15);
- if (randomNumber <= 13) {
- status = "Antiban - RandomTab";
- if (randomNumber == 1) {
- Tabs.ATTACK.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 2) {
- Tabs.EQUIPMENT.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 3) {
- Tabs.INVENTORY.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 4) {
- Tabs.MAGIC.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 5) {
- Tabs.STATS.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 6) {
- Tabs.QUESTS.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 7) {
- Tabs.PRAYER.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 8) {
- Tabs.MUSIC.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 9) {
- Tabs.TASK_LIST.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 10) {
- Tabs.FRIENDS.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 11) {
- Tabs.CLAN_CHAT.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 12) {
- Tabs.FRIENDS_CHAT.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- if (randomNumber == 13) {
- Tabs.STATS.open();
- Time.sleep(Random.nextInt(600, 1200));
- int random = Random.nextInt(1, 3);
- if (random == 1) {
- Mouse.move(642, 336, 90, 120);
- Time.sleep(Random.nextInt(800, 1400));
- } else {
- Time.sleep(Random.nextInt(1300, 3200));
- }
- }
- }
- }
- }
- public class ProFisherGUI extends JFrame {
- private static final long serialVersionUID = 1L;
- public ProFisherGUI() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- TypeofFish = FishBox.getSelectedItem().toString();
- Location = LocationBox.getSelectedItem().toString();
- Banking = BankBox.getSelectedItem().toString();
- if (TypeofFish.equals("Shark")) {
- FISH_SPOT = sharks;
- FISH_TYPE = "Harpoon";
- }
- if (TypeofFish.equals("Monkfish")) {
- FISH_SPOT = monk;
- FISH_TYPE = "Net";
- }
- if (TypeofFish.equals("Lobster")) {
- FISH_SPOT = tuna;
- FISH_TYPE = "Cage";
- }
- if (TypeofFish.equals("Tuna/Swordfish")) {
- FISH_SPOT = tuna;
- FISH_TYPE = "Harpoon";
- }
- if (TypeofFish.equals("Pike")) {
- FISH_SPOT = trout;
- FISH_TYPE = "Bait";
- }
- if (TypeofFish.equals("Salmom/Trout")) {
- FISH_SPOT = trout;
- FISH_TYPE = "Lure";
- }
- if (TypeofFish.equals("Herring/Sardine")) {
- FISH_SPOT = shrimp;
- FISH_TYPE = "Bait";
- }
- if (TypeofFish.equals("Shrimp")) {
- FISH_SPOT = shrimp;
- FISH_TYPE = "Net";
- }
- if (Location.equals("Catherby")) {
- atBankSpot = atcatherbyBank();
- atFishingSpot = atCatherby();
- BankTile = gotocatherbybank;
- FishTile = gotocatherby;
- }
- if (Location.equals("Draynor")) {
- atBankSpot = atdraynorBank();
- atFishingSpot = atDraynor();
- BankTile = gotodraynorbank;
- FishTile = gotodraynor;
- }
- if (Location.equals("Barbarian Village")) {
- atBankSpot = atbarbBank();
- atFishingSpot = atBarb();
- BankTile = gotobarbbank;
- FishTile = gotobarb;
- }
- if (Location.equals("Karamja")) {
- atBankSpot = atkaramjaBank();
- atFishingSpot = atKaramja();
- BankTile = gotokaramjabank;
- FishTile = gotokaramja;
- type = "Exchange";
- statusmessage = "Stiles";
- method = "Exchange";
- }
- if (Location.equals("Fishing Guild")) {
- atBankSpot = atguildBank();
- atFishingSpot = atFishing1();
- atFishingSpot2 = atFishing2();
- BankTile = gotoguildbank;
- FishTile = gotoguild;
- }
- if (Location.equals("Shilo Village")) {
- atBankSpot = atshiloBank();
- atFishingSpot = atShilo1();
- atFishingSpot2 = atShilo2();
- BankTile = gotoshilobank;
- FishTile = gotoshilo;
- type = "Banking";
- statusmessage = "Bankers";
- method = "Bank";
- }
- if (Location.equals("Fishing Colony")) {
- atBankSpot = atcolonyBank();
- atFishingSpot = atMonk1();
- atFishingSpot2 = atMonk2();
- atFishingSpot3 = atMonk3();
- BankTile = gotocolonybank;
- FishTile = gotocolony;
- type = "Banking";
- statusmessage = "Bankers";
- method = "Bank";
- }
- if (Banking.equals("Drop")) {
- BANK = false;
- }
- if (Location.equals("Karamja") || Location.equals("Fishing Colony") || Location.equals("Shilo Village")) {
- NPCBankers = true;
- }
- gui.setVisible(false);
- gui.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- FishBox = new JComboBox();
- LocationBox = new JComboBox();
- BankBox = new JComboBox();
- ProFisher = new JLabel();
- Himekp = new JLabel();
- panel1 = new JPanel();
- label1 = new JLabel();
- label2 = new JLabel();
- label3 = new JLabel();
- button1 = new JButton();
- //======== this ========
- setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- setTitle("ProFisher by Himekp");
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- contentPane.add(FishBox);
- FishBox.setBounds(15, 135, 120, FishBox.getPreferredSize().height);
- FishBox.setModel(new DefaultComboBoxModel(new String[] {
- "Shrimp", "Herring/Sardine", "Salmon/Trout",
- "Pike", "Tuna/Swordfish", "Lobster", "Monkfish",
- "Shark"
- }));
- contentPane.add(LocationBox);
- LocationBox.setBounds(15, 90, 120, LocationBox.getPreferredSize().height);
- LocationBox.setModel(new DefaultComboBoxModel(new String[] {
- "Draynor", "Barbarian Village", "Karamja",
- "Catherby", "Fishing Guild", "Shilo Village",
- "Fishing Colony"
- }));
- contentPane.add(BankBox);
- BankBox.setBounds(15, 180, 120, BankBox.getPreferredSize().height);
- BankBox.setModel(new DefaultComboBoxModel(new String[] {
- "Bank", "Drop"
- }));
- //---- ProFisher ----
- ProFisher.setText("ProFisher");
- ProFisher.setFont(new Font("Baveuse", Font.BOLD, 28));
- contentPane.add(ProFisher);
- ProFisher.setBounds(10, 5, 220, 55);
- //---- Himekp ----
- Himekp.setText("By: Himekp");
- Himekp.setFont(new Font("Baveuse", Font.BOLD, 24));
- contentPane.add(Himekp);
- Himekp.setBounds(new Rectangle(new Point(45, 45), Himekp.getPreferredSize()));
- //======== panel1 ========
- {
- // JFormDesigner evaluation mark
- panel1.setBorder(new javax.swing.border.CompoundBorder(
- new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
- "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
- javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
- java.awt.Color.red), panel1.getBorder()));
- panel1.addPropertyChangeListener(new java.beans.PropertyChangeListener(){
- public void propertyChange(java.beans.PropertyChangeEvent e){
- if("border".equals(e.getPropertyName()))
- throw new RuntimeException();
- }
- });
- panel1.setLayout(null);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < panel1.getComponentCount(); i++) {
- Rectangle bounds = panel1.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel1.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel1.setMinimumSize(preferredSize);
- panel1.setPreferredSize(preferredSize);
- }
- }
- contentPane.add(panel1);
- panel1.setBounds(new Rectangle(new Point(0, 0), panel1.getPreferredSize()));
- //---- label1 ----
- label1.setText("Location:");
- contentPane.add(label1);
- label1.setBounds(new Rectangle(new Point(15, 75), label1.getPreferredSize()));
- //---- label2 ----
- label2.setText("Type of Fish:");
- contentPane.add(label2);
- label2.setBounds(new Rectangle(new Point(15, 120), label2.getPreferredSize()));
- //---- label3 ----
- label3.setText("Banking:");
- contentPane.add(label3);
- label3.setBounds(new Rectangle(new Point(15, 165), label3.getPreferredSize()));
- //---- button1 ----
- button1.setText("Start");
- contentPane.add(button1);
- button1.setBounds(140, 90, 75, 115);
- button1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- private JComboBox FishBox;
- private JComboBox LocationBox;
- private JComboBox BankBox;
- private JLabel ProFisher;
- private JLabel Himekp;
- private JPanel panel1;
- private JLabel label1;
- private JLabel label2;
- private JLabel label3;
- private JButton button1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- //Paint
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- private final Color color1 = new Color(0, 0, 153, 137);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color4 = new Color(0, 0, 0);
- private final Color color5 = new Color(255, 255, 255);
- private final BasicStroke stroke2 = new BasicStroke(1);
- private final Font font3 = new Font("Arial", 0, 12);
- private final Font font4 = new Font("Harlow Solid Italic", 1, 32);
- private final Font font5 = new Font("Harlow Solid Italic", 0, 20);
- private final Image img1 = getImage("http://img98.imageshack.us/img98/6577/banners3.jpg");
- private final Image img2 = getImage("http://images.wikia.com/runescape/images/c/c3/Raw_lobster_detail.png");
- private final Font font6 = new Font("Arial", 0, 13);
- private final Color color7 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- Rectangle closeButton = new Rectangle(400, 7, 111, 27);
- boolean showPaint = true;
- Color buttonColor = new Color(0, 0, 102, 163);
- Color black = new Color(0, 0, 0);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setColor(buttonColor);
- g.fillRect(closeButton.x, closeButton.y, closeButton.width, closeButton.height);
- g.setColor(black);
- g.setStroke(stroke1);
- g.drawRect(closeButton.x, closeButton.y, closeButton.width, closeButton.height);
- if(showPaint){
- long runTime = 0;
- long seconds = 0;
- long minutes = 0;
- long hours = 0;
- runTime = System.currentTimeMillis() - startTime;
- seconds = runTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= (minutes * 60);
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= (hours * 60);
- }
- currentXP = Skills.getExperience(Skills.FISHING);
- final int EXPperhour = (int) ((currentXP - startingXP) * 3600000.0 / runTime);
- final int EXPgained = (int) (currentXP - startingXP);
- currentLevel = Skills.getLevel(Skills.FISHING);
- FishCaughtperhour = (int) ((FishCaught) * 3600000.0 / runTime);
- final int percent = Skills.getExperience(Skills.FISHING);
- g.drawString("Percent till next level: ", 560, 450);
- g.setColor(Color.red);
- g.fillRoundRect(560, 450, 100, 10, 15, 15);
- g.setColor(Color.green);
- g.fillRoundRect(560, 450, percent, 10, 15, 15);
- g.setColor(Color.black);
- g.drawString("" + percent + "%" , 603, 460);
- g.setColor(color1);
- g.fillRect(6, 345, 505, 128);
- g.setColor(color4);
- g.setStroke(stroke2);
- g.drawImage(img1, 6, 346, null);
- g.drawImage(img2, 9, 309, null);
- g.setFont(font3);
- g.setColor(color5);
- g.drawString("Fish Caught : " + FishCaught, 219, 436);
- g.setColor(color2);
- g.drawString("Fish Caught : " + FishCaught, 218, 435);
- g.setColor(color5);
- g.drawString("Exp Gained : " + EXPgained, 219, 399);
- g.setColor(color2);
- g.drawString("Exp Gained : " + EXPgained, 218, 398);
- g.setColor(color5);
- g.drawString("Exp Per Hour : " + EXPperhour, 219, 418);
- g.setColor(color2);
- g.drawString("Exp Per Hour : " + EXPperhour, 218, 417);
- g.setColor(color5);
- g.drawString("Run Time : " + hours + ":" + minutes + ":" + seconds, 219, 364);
- g.setColor(color2);
- g.drawString("Run Time : " + hours + ":" + minutes + ":" + seconds, 218, 363);
- g.setColor(color5);
- g.drawString("Fish Caught / Hour : " + FishCaughtperhour, 219, 453);
- g.setColor(color2);
- g.drawString("Fish Caught / Hour : " + FishCaughtperhour, 218, 452);
- g.setColor(color5);
- g.drawString("Current Level : " + currentLevel + "(" + levelsgained + ")", 219, 381);
- g.setColor(color2);
- g.drawString("Current Level : " + currentLevel + "(" + levelsgained + ")", 218, 380);
- g.setFont(font4);
- g.setColor(color7);
- g.drawString("ProFisher", 31, 379);
- g.setColor(color5);
- g.drawString("ProFisher", 28, 376);
- g.setColor(color7);
- g.setFont(font5);
- g.drawString("By: Himekp", 104, 401);
- g.setColor(color5);
- g.drawString("By: Himekp", 101, 398);
- g.setColor(color5);
- g.setFont(font6);
- g.drawString("Show / Hide Paint", 405, 25);
- g.setColor(color5);
- g.drawString("Status : " + status, 219, 470);
- g.setColor(color2);
- g.drawString("Status : " + status, 218, 469);
- } else {
- g.setColor(color5);
- g.setFont(font6);
- g.drawString("Show / Hide Paint", 405, 25);
- }
- Point p = new Point(Mouse.getX(),Mouse.getY());
- g.setColor(Color.RED);
- g.drawLine(0, p.y, 800, p.y);
- g.drawLine(p.x, 0, p.x, 800);
- g.setColor(Color.BLUE);
- }
- Point p;
- public void mouseClicked(MouseEvent e){
- p = e.getPoint();
- if(closeButton.contains(p)){
- showPaint = !showPaint;
- }
- }
- public void messageReceived(MessageEvent message) {
- String x = message.getMessage().toString().toLowerCase();
- if (x.contains("you catch a")){
- FishCaught +=1;
- }
- if (x.contains("you catch some")){
- FishCaught +=1;
- }
- if (x.contains("two")){
- FishCaught +=2;
- }
- if (x.contains("You've just advanced a")){
- levelsgained++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment