Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xobot.client.events.MessageEvent;
- import java.text.NumberFormat;
- import java.util.Locale;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JDialog;
- import java.awt.Color;
- import java.awt.Dimension;
- import java.awt.FlowLayout;
- import java.awt.Graphics;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import xobot.script.wrappers.interactive.GameObject;
- import xobot.script.wrappers.interactive.Item;
- import xobot.script.wrappers.interactive.NPC;
- import xobot.script.methods.NPCs;
- import xobot.script.methods.Bank;
- import xobot.script.methods.GameObjects;
- import xobot.script.methods.tabs.Inventory;
- import xobot.script.methods.tabs.Skills;
- import xobot.script.util.Time;
- import xobot.script.methods.Players;
- import xobot.script.methods.Packets;
- import xobot.script.methods.Widgets;
- import xobot.script.methods.input.KeyBoard;
- import xobot.script.methods.Walking;
- import xobot.script.util.Timer;
- import xobot.script.Manifest;
- import xobot.client.callback.listeners.MessageListener;
- import xobot.client.callback.listeners.PaintListener;
- import xobot.script.ActiveScript;
- import xobot.script.wrappers.Tile;
- @Manifest(authors = { "Simmy" }, name = "Simmys Universal Fisher", description = "Will Fish Raw Karambwans + Karambwans Bait + Raw Rocktail with Banking.", version = 1.01)
- public class UniversalFisher extends ActiveScript implements PaintListener, MessageListener{
- private Timer timer;
- private boolean Stop = false;
- private boolean KBWalk = false;
- private boolean RRFish = false;
- private boolean KBFish = false;
- private boolean RKFish = false;
- private static final Tile KBTile = new Tile(2811, 3016, 0);
- public static int Fish = 0;
- private int FishExp = 0;
- String status = "We Are Currently Starting The Script Up; Please Kick Back And Relax!";
- String[] FishingChoice = {"Fish Karambwan Bait", "Fish Raw Karambwans", "Fish Raw Rocktails(Catherby)"};
- JComboBox combo = new JComboBox(FishingChoice);
- public boolean onStart() {
- JDialog frame = new JDialog();
- frame.setPreferredSize(new Dimension(300,80));
- frame.setLocationRelativeTo(null);
- frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
- FlowLayout layout = new FlowLayout();
- layout.setHgap(5);
- layout.setVgap(5);
- frame.setLayout(layout);
- combo.setPreferredSize(new Dimension(200,30));
- combo.setFocusable(false);
- JButton button = new JButton("Start");
- button.setFocusable(false);
- button.setPreferredSize(new Dimension(60,32));
- button.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent arg0) {
- switch(combo.getSelectedItem().toString()) {
- case "Fish Karambwan Bait":
- KBFish = true;
- break;
- case "Fish Raw Karambwans":
- RKFish = true;
- break;
- case "Fish Raw Rocktails(Catherby)":
- RRFish = true;
- break;
- }
- frame.dispose();
- }
- });
- frame.add(combo);
- frame.add(button);
- frame.setTitle("What Kind Of Fishing Would You Like To Do?");
- frame.pack();
- frame.setVisible(true);
- while(frame.isVisible()) {
- Time.sleep(250, 350);
- }
- this.timer = new Timer();
- this.FishExp = Skills.FISHING.getCurrentExp();
- return true;
- }
- @Override
- public void MessageRecieved(MessageEvent message) {
- if (message.getMessage().contentEquals("You catch a karambwan."))
- Fish += 1;
- if (message.getMessage().contentEquals("You catch a rocktail."))
- Fish += 1;
- if (message.getMessage().contentEquals("You catch some karambwanji."))
- Fish += 20;
- if (message.getMessage().contentEquals("There") | message.getMessage().contentEquals("Bot") | message.getMessage().contentEquals("Sup") | message.getMessage().contentEquals("Teleported")) {
- Stop = true;
- }
- if (message.getMessage().contentEquals("Doing") | message.getMessage().contentEquals("Here") | message.getMessage().contentEquals("Botting") | message.getMessage().contentEquals("Afk") | message.getMessage().contentEquals("Teleport") | message.getMessage().contentEquals("How Many")) {
- Stop = true;
- }
- }
- @Override
- public void repaint(Graphics g) {
- final int FishesCaught = (int)(Fish * 3600000.0 / this.timer.getElapsed());
- final int FishXp = Skills.FISHING.getCurrentExp() - this.FishExp;
- final int FishXpHr = (int) (FishXp * 3600000.0D / this.timer.getElapsed());
- g.setColor(Color.white);
- g.drawString("Current Status: " + status, 15, 250);
- g.drawString("Time Running: " + this.timer.toElapsedString(), 15, 265);
- g.drawString("Fish Caught: " + Fish, 15, 280);
- g.drawString("Fish Caught (hr): " + NumberFormat.getNumberInstance(Locale.US).format(FishesCaught), 15, 295);
- g.drawString("Fishing Exp Gained: " + NumberFormat.getNumberInstance(Locale.US).format(FishXp), 15, 310);
- g.drawString("Fishing Exp (hr): " + NumberFormat.getNumberInstance(Locale.US).format(FishXpHr), 15, 325);
- g.drawString("Universal Fisher by Simmy", 160, 30);
- }
- @Override
- public int loop() {
- //Add Variables Here;
- NPC RRSpot = NPCs.getNearest(8842);
- NPC RKSpot = NPCs.getNearest(1178);
- NPC KBSpot = NPCs.getNearest(1174);
- NPC Banker = NPCs.getNearest(494);
- NPC FSpots = NPCs.getNearest(1174, 1178, 8842);
- Item LVessel = Inventory.getItem(3159);
- Item VBait = Inventory.getItem(3150);
- Item RRSetup = Inventory.getItem(307, 15263);
- Item RKSetup = Inventory.getItem(3159, 3150);
- Item KBSetup = Inventory.getItem(303);
- GameObject ZRing1 = GameObjects.getNearest(14097);
- GameObject ZRing2 = GameObjects.getNearest(12128);
- GameObject Well = GameObjects.getNearest(26945);
- if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & RKSpot != null & LVessel != null & VBait != null & RKFish == true & Stop == false) {
- status = "We Are Attempting To Fish Karambwans!";
- RKSpot.interact("Fish");
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == 21193, 7500);
- }
- if (Players.getMyPlayer().getAnimation() == 21193 & Inventory.getFreeSlots() >= 1 & RKFish == true) {
- status = "We Are Currently Fishing Karambwans!";
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
- }
- if (Inventory.isFull() & Banker != null & Widgets.getOpenInterface() == -1 & RKFish == true) {
- status = "We Are Interacting With The Banker!";
- Banker.interact("Bank");
- Time.sleep(() -> Bank.isOpen(), 5500);
- }
- if (Inventory.isFull() & Widgets.getOpenInterface() == 5292 & RKFish == true) {
- status = "We Are Banking The Batch Of Karambwans!";
- Time.sleep(750, 800);
- Bank.deposit(3142, 27);
- Time.sleep(() -> Inventory.getFreeSlots() >= 1, 1250);
- }
- /* ^^^^ Fishing Karambwans Stage ^^^^^^ */
- if (KBSpot != null & Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & KBFish == true & KBWalk == false & Stop == false) {
- status = "We Are Attempting To Fish Karambwans Bait!";
- KBSpot.interact("Net");
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == 20621, 5500);
- }
- if (KBSpot != null & Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & KBFish == true & KBWalk == true) {
- status = "We Are Walking To Fish Karambwans Bait Area!";
- Walking.walkTo(KBTile);
- Time.sleep(13500, 15000);
- KBWalk = false;
- }
- if (Players.getMyPlayer().getAnimation() == 20621 & Inventory.getFreeSlots() >= 1 & KBFish == true) {
- status = "We Are Currently Fishing Bait For Karambwans!";
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
- }
- /* ^^^^^^ Fishing Karambwan Bait Stage ^^^^^^ */
- if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & RRSpot != null & RRSetup != null & RRFish == true & Stop == false) {
- status = "We Are Attempting To Fish Rocktails!";
- RRSpot.interact("Bait");
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == 622, 7500);
- }
- if (Players.getMyPlayer().getAnimation() == 622 & Inventory.getFreeSlots() >= 1 & RRFish == true) {
- status = "We Are Currently Fishing Rocktails!";
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
- }
- if (Inventory.isFull() & Banker != null & Widgets.getOpenInterface() == -1 & RRFish == true) {
- status = "We Are Interacting With The Banker!";
- Banker.interact("Bank");
- Time.sleep(() -> Bank.isOpen(), 5500);
- }
- if (Inventory.isFull() & Widgets.getOpenInterface() == 5292 & RRFish == true) {
- status = "We Are Banking The Batch Of Rocktails!";
- Time.sleep(750);
- Bank.deposit(15270, 27);
- Time.sleep(() -> Inventory.getFreeSlots() >= 1, 1250);
- }
- /* ^^^^^^ Fishing Rocktail Stage ^^^^^^ */
- if (KBSetup == null & RKSetup == null & RRSetup == null & Banker == null) {
- status = "We Are Teleporting Home!";
- Packets.sendAction(315, 2, -1, 30000);
- Time.sleep(() -> Banker == null, 10000);
- }
- if (KBSetup == null & RKSetup == null & RRSetup == null & Banker != null & Widgets.getOpenInterface() == -1) {
- status = "Attempting To Open The Bank!";
- Banker.interact("Bank");
- Time.sleep(() -> Widgets.getOpenInterface() == 5292, 7500);
- }
- if (KBSetup == null & KBFish == true & Widgets.getOpenInterface() == 5292) {
- status = "Attempting To Withdraw Bait Fishing Setup!";
- Time.sleep(1350, 1700);
- Bank.depositAll();
- Time.sleep(1350, 1700);
- Bank.withdraw(303, 1);
- Time.sleep(() -> KBSetup != null, 2000);
- }
- if (RKSetup == null & RKFish == true & Widgets.getOpenInterface() == 5292) {
- status = "Attempting To Withdraw Raw Karambwans Setup!";
- Time.sleep(1350, 1700);
- Bank.depositAll();
- Time.sleep(1350, 1700);
- Bank.withdraw(3159, 1);
- Time.sleep(1350, 1700);
- Bank.withdraw(3150, 50000);
- Time.sleep(() -> RKSetup != null, 2000);
- }
- if (RRSetup == null & RRFish == true & Widgets.getOpenInterface() == 5292) {
- status = "Attempting To Withdraw Rocktail Fishing Setup!";
- Time.sleep(1350, 1700);
- Bank.depositAll();
- Time.sleep(1350, 1700);
- Bank.withdraw(307, 1);
- Time.sleep(1350, 1700);
- Bank.withdraw(15263, 50000);
- Time.sleep(() -> RRSetup != null, 2000);
- }
- /* ^^^^^^ Dealing With Home Part & Banking ^^^^^ */
- if (ZRing1 != null & Well != null & FSpots == null) {
- status = "We Are Walking To Zanaris Fairyring!";
- ZRing1.interact("Use");
- Time.sleep(() -> ZRing1 == null, 7000);
- }
- if (ZRing2 != null & KBSpot == null & KBFish == true) {
- status = "Attempting To Teleport To Karambwans Bait Area!";
- ZRing2.interact("use");
- Time.sleep(3500, 4500);
- KeyBoard.typeWord("333", 225, true);
- Time.sleep(() -> ZRing2 == null, 7000);
- KBWalk = true;
- }
- if (ZRing2 != null & RKSpot == null & RKFish == true) {
- status = "Attempting To Teleport To Raw Karambwans Area!";
- ZRing2.interact("use");
- Time.sleep(3500, 4500);
- KeyBoard.typeWord("231", 225, true);
- Time.sleep(() -> ZRing2 == null, 8500);
- }
- if (RRSpot == null & RRFish == true) {
- status = "Attempting To Teleport To Rocktail Area!";
- Packets.sendAction(315, 4, -1, 27054);
- Time.sleep(() -> RRSpot != null, 7000);
- }
- if (Stop == true) {
- status = "Something/Someone Has Interrupted Us :(!";
- Time.sleep(125000, 150000);
- Stop = false;
- }
- /* ^^^^^ Teleporting Stages & AntiBan ^^^^^ */
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement