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 java.awt.Color;
- import java.awt.Graphics;
- 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.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 = "Universal Fishing Contest", description = "Will Fish at the Fishing Contest with Fly Fishing Rod + Feathers (Banks At Full Inventory)", version = 1.01)
- public class UniversalFishingContest extends ActiveScript implements PaintListener, MessageListener{
- private Timer timer;
- private static final Tile StandingTile = new Tile(2525, 4778, 0);
- public static int Fish = 0;
- public static int Casket = 0;
- private int FishExp = 0;
- String status = "We Are Currently Starting The Script Up; Please Kick Back And Relax!";
- public boolean onStart() {
- this.timer = new Timer();
- this.FishExp = Skills.FISHING.getCurrentExp();
- return true;
- }
- @Override
- public void MessageRecieved(MessageEvent message) {
- if (message.getMessage().contentEquals("You catch a trout."))
- Fish += 1;
- if (message.getMessage().contentEquals("You catch a salmon."))
- Fish += 1;
- if (message.getMessage().contentEquals("You found a strange casket."))
- Casket += 1;
- }
- @Override
- public void repaint(Graphics g) {
- final int FishXp = Skills.FISHING.getCurrentExp() - this.FishExp;
- g.setColor(Color.YELLOW);
- g.drawString("Current Status: " + status, 15, 265);
- g.drawString("Time Running: " + this.timer.toElapsedString(), 15, 280);
- g.drawString("Fishing Exp Gained: " + NumberFormat.getNumberInstance(Locale.US).format(FishXp), 15, 295);
- g.drawString("Fish Caught: " + Fish, 15, 310);
- g.drawString("2.5M Caskets: " + Casket, 15, 325);
- g.drawString("Universal Fishing Contest by Simmy", 180, 30);
- }
- @Override
- public int loop() {
- //Add Variables Here;
- NPC FSpot = NPCs.getNearest(309);
- NPC Banker = NPCs.getNearest(494);
- NPC Evilbob = NPCs.getNearest(2479);
- Item FRod = Inventory.getItem(309);
- Item FBait = Inventory.getItem(314);
- Item Fishes = Inventory.getItem(335, 331);
- GameObject Portal = GameObjects.getNearest(8987);
- if (Evilbob == null & Portal == null) {
- status = "We Are Currently Teleporting Back To The Fishing Contest!";
- Packets.sendAction(315, 4, -1, 26490);
- Time.sleep(() -> Evilbob != null, 6500);
- } else {
- if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & FSpot != null & FRod != null & FBait != null) {
- status = "We Are Attempting To Fish At The Fishing Contest!";
- FSpot.interact("Lure");
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == 21193, 7500);
- }
- else if (Players.getMyPlayer().getAnimation() == 622 & Inventory.getFreeSlots() >= 1 & FSpot != null & Portal != null & FRod != null & FBait != null) {
- status = "We Are Currently Fishing At The Fishing Contest!!";
- Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
- } else {
- if (FRod == null & FBait == null & Widgets.getOpenInterface() == -1 & Banker != null) {
- status = "We Are Interacting With The Banker(Finding Setup)!";
- Banker.interact("Bank");
- Time.sleep(() -> Bank.isOpen(), 5500);
- }
- else if (FRod == null & Widgets.getOpenInterface() == 5292 & Banker != null) {
- status = "Withdrawing Fly Fishing Rod From Bank!";
- Bank.withdraw(309, 1);
- Time.sleep(() -> FRod != null, 2500);
- }
- else if (FBait == null & FRod != null & Widgets.getOpenInterface() == 5292 & Banker != null) {
- status = "Withdrawing Feathers From Bank!";
- Bank.withdraw(314, 10000);
- Time.sleep(() -> FBait != null, 2500);
- } else {
- if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & FSpot == null & Portal != null & FRod != null & FBait != null) {
- status = "Walking To The Centre & Waiting For Fishing Spot To Respawn!";
- Walking.walkTo(StandingTile);
- Time.sleep(() -> FSpot != null, 12500);
- } else {
- if (Inventory.isFull() & Widgets.getOpenInterface() == -1 & Banker != null & FRod != null & FBait != null) {
- status = "We Are Interacting With The Banker!";
- Banker.interact("Bank");
- Time.sleep(() -> Bank.isOpen(), 5500);
- }
- else if (Inventory.isFull() & Widgets.getOpenInterface() == 5292 & Banker != null & FRod != null & FBait != null) {
- status = "We Are Banking The Batch Of Fishes!";
- Time.sleep(750, 800);
- Bank.depositAllExcept(309, 314);
- Time.sleep(() -> Fishes == null, 1250);
- }
- }
- }
- }
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement