Advertisement
SimmysProjects

Universal Fishing Contest - Soulplay

Sep 26th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. import xobot.client.events.MessageEvent;
  2. import java.text.NumberFormat;
  3. import java.util.Locale;
  4. import java.awt.Color;
  5. import java.awt.Graphics;
  6. import xobot.script.wrappers.interactive.GameObject;
  7. import xobot.script.wrappers.interactive.Item;
  8. import xobot.script.wrappers.interactive.NPC;
  9. import xobot.script.methods.NPCs;
  10. import xobot.script.methods.Bank;
  11. import xobot.script.methods.GameObjects;
  12. import xobot.script.methods.tabs.Inventory;
  13. import xobot.script.methods.tabs.Skills;
  14. import xobot.script.util.Time;
  15. import xobot.script.methods.Players;
  16. import xobot.script.methods.Packets;
  17. import xobot.script.methods.Widgets;
  18. import xobot.script.methods.Walking;
  19. import xobot.script.util.Timer;
  20. import xobot.script.Manifest;
  21. import xobot.client.callback.listeners.MessageListener;
  22. import xobot.client.callback.listeners.PaintListener;
  23. import xobot.script.ActiveScript;
  24. import xobot.script.wrappers.Tile;
  25.  
  26. @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)
  27. public class UniversalFishingContest extends ActiveScript implements PaintListener, MessageListener{
  28.  
  29. private Timer timer;
  30. private static final Tile StandingTile = new Tile(2525, 4778, 0);
  31. public static int Fish = 0;
  32. public static int Casket = 0;
  33. private int FishExp = 0;
  34.  
  35. String status = "We Are Currently Starting The Script Up; Please Kick Back And Relax!";
  36. public boolean onStart() {
  37. this.timer = new Timer();
  38. this.FishExp = Skills.FISHING.getCurrentExp();
  39. return true;
  40. }
  41.  
  42. @Override
  43. public void MessageRecieved(MessageEvent message) {
  44. if (message.getMessage().contentEquals("You catch a trout."))
  45. Fish += 1;
  46. if (message.getMessage().contentEquals("You catch a salmon."))
  47. Fish += 1;
  48. if (message.getMessage().contentEquals("You found a strange casket."))
  49. Casket += 1;
  50. }
  51.  
  52.  
  53. @Override
  54. public void repaint(Graphics g) {
  55. final int FishXp = Skills.FISHING.getCurrentExp() - this.FishExp;
  56. g.setColor(Color.YELLOW);
  57. g.drawString("Current Status: " + status, 15, 265);
  58. g.drawString("Time Running: " + this.timer.toElapsedString(), 15, 280);
  59. g.drawString("Fishing Exp Gained: " + NumberFormat.getNumberInstance(Locale.US).format(FishXp), 15, 295);
  60. g.drawString("Fish Caught: " + Fish, 15, 310);
  61. g.drawString("2.5M Caskets: " + Casket, 15, 325);
  62. g.drawString("Universal Fishing Contest by Simmy", 180, 30);
  63. }
  64.  
  65. @Override
  66. public int loop() {
  67. //Add Variables Here;
  68. NPC FSpot = NPCs.getNearest(309);
  69. NPC Banker = NPCs.getNearest(494);
  70. NPC Evilbob = NPCs.getNearest(2479);
  71. Item FRod = Inventory.getItem(309);
  72. Item FBait = Inventory.getItem(314);
  73. Item Fishes = Inventory.getItem(335, 331);
  74. GameObject Portal = GameObjects.getNearest(8987);
  75.  
  76. if (Evilbob == null & Portal == null) {
  77. status = "We Are Currently Teleporting Back To The Fishing Contest!";
  78. Packets.sendAction(315, 4, -1, 26490);
  79. Time.sleep(() -> Evilbob != null, 6500);
  80. } else {
  81. if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & FSpot != null & FRod != null & FBait != null) {
  82. status = "We Are Attempting To Fish At The Fishing Contest!";
  83. FSpot.interact("Lure");
  84. Time.sleep(() -> Players.getMyPlayer().getAnimation() == 21193, 7500);
  85. }
  86. else if (Players.getMyPlayer().getAnimation() == 622 & Inventory.getFreeSlots() >= 1 & FSpot != null & Portal != null & FRod != null & FBait != null) {
  87. status = "We Are Currently Fishing At The Fishing Contest!!";
  88. Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
  89. } else {
  90. if (FRod == null & FBait == null & Widgets.getOpenInterface() == -1 & Banker != null) {
  91. status = "We Are Interacting With The Banker(Finding Setup)!";
  92. Banker.interact("Bank");
  93. Time.sleep(() -> Bank.isOpen(), 5500);
  94. }
  95. else if (FRod == null & Widgets.getOpenInterface() == 5292 & Banker != null) {
  96. status = "Withdrawing Fly Fishing Rod From Bank!";
  97. Bank.withdraw(309, 1);
  98. Time.sleep(() -> FRod != null, 2500);
  99. }
  100. else if (FBait == null & FRod != null & Widgets.getOpenInterface() == 5292 & Banker != null) {
  101. status = "Withdrawing Feathers From Bank!";
  102. Bank.withdraw(314, 10000);
  103. Time.sleep(() -> FBait != null, 2500);
  104. } else {
  105. if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & FSpot == null & Portal != null & FRod != null & FBait != null) {
  106. status = "Walking To The Centre & Waiting For Fishing Spot To Respawn!";
  107. Walking.walkTo(StandingTile);
  108. Time.sleep(() -> FSpot != null, 12500);
  109. } else {
  110. if (Inventory.isFull() & Widgets.getOpenInterface() == -1 & Banker != null & FRod != null & FBait != null) {
  111. status = "We Are Interacting With The Banker!";
  112. Banker.interact("Bank");
  113. Time.sleep(() -> Bank.isOpen(), 5500);
  114. }
  115. else if (Inventory.isFull() & Widgets.getOpenInterface() == 5292 & Banker != null & FRod != null & FBait != null) {
  116. status = "We Are Banking The Batch Of Fishes!";
  117. Time.sleep(750, 800);
  118. Bank.depositAllExcept(309, 314);
  119. Time.sleep(() -> Fishes == null, 1250);
  120. }
  121. }
  122. }
  123. }
  124. }
  125. return 0;
  126. }
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement