Advertisement
SimmysProjects

UniversalFisher - Soulplay

Sep 25th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.81 KB | None | 0 0
  1. import xobot.client.events.MessageEvent;
  2. import java.text.NumberFormat;
  3. import java.util.Locale;
  4. import javax.swing.JButton;
  5. import javax.swing.JComboBox;
  6. import javax.swing.JDialog;
  7. import java.awt.Color;
  8. import java.awt.Dimension;
  9. import java.awt.FlowLayout;
  10. import java.awt.Graphics;
  11. import java.awt.event.ActionEvent;
  12. import java.awt.event.ActionListener;
  13. import xobot.script.wrappers.interactive.GameObject;
  14. import xobot.script.wrappers.interactive.Item;
  15. import xobot.script.wrappers.interactive.NPC;
  16. import xobot.script.methods.NPCs;
  17. import xobot.script.methods.Bank;
  18. import xobot.script.methods.GameObjects;
  19. import xobot.script.methods.tabs.Inventory;
  20. import xobot.script.methods.tabs.Skills;
  21. import xobot.script.util.Time;
  22. import xobot.script.methods.Players;
  23. import xobot.script.methods.Packets;
  24. import xobot.script.methods.Widgets;
  25. import xobot.script.methods.input.KeyBoard;
  26. import xobot.script.methods.Walking;
  27. import xobot.script.util.Timer;
  28. import xobot.script.Manifest;
  29. import xobot.client.callback.listeners.MessageListener;
  30. import xobot.client.callback.listeners.PaintListener;
  31. import xobot.script.ActiveScript;
  32. import xobot.script.wrappers.Tile;
  33.  
  34. @Manifest(authors = { "Simmy" }, name = "Simmys Universal Fisher", description = "Will Fish Raw Karambwans + Karambwans Bait + Raw Rocktail with Banking.", version = 1.01)
  35. public class UniversalFisher extends ActiveScript implements PaintListener, MessageListener{
  36.  
  37. private Timer timer;
  38. private boolean Stop = false;
  39. private boolean KBWalk = false;
  40. private boolean RRFish = false;
  41. private boolean KBFish = false;
  42. private boolean RKFish = false;
  43. private static final Tile KBTile = new Tile(2811, 3016, 0);
  44. public static int Fish = 0;
  45. private int FishExp = 0;
  46.  
  47. String status = "We Are Currently Starting The Script Up; Please Kick Back And Relax!";
  48. String[] FishingChoice = {"Fish Karambwan Bait", "Fish Raw Karambwans", "Fish Raw Rocktails(Catherby)"};
  49. JComboBox combo = new JComboBox(FishingChoice);
  50.  
  51. public boolean onStart() {
  52.  
  53. JDialog frame = new JDialog();
  54. frame.setPreferredSize(new Dimension(300,80));
  55. frame.setLocationRelativeTo(null);
  56. frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  57. FlowLayout layout = new FlowLayout();
  58. layout.setHgap(5);
  59. layout.setVgap(5);
  60. frame.setLayout(layout);
  61.  
  62. combo.setPreferredSize(new Dimension(200,30));
  63. combo.setFocusable(false);
  64.  
  65. JButton button = new JButton("Start");
  66. button.setFocusable(false);
  67. button.setPreferredSize(new Dimension(60,32));
  68. button.addActionListener(new ActionListener() {
  69.  
  70. @Override
  71. public void actionPerformed(ActionEvent arg0) {
  72. switch(combo.getSelectedItem().toString()) {
  73. case "Fish Karambwan Bait":
  74. KBFish = true;
  75. break;
  76. case "Fish Raw Karambwans":
  77. RKFish = true;
  78. break;
  79. case "Fish Raw Rocktails(Catherby)":
  80. RRFish = true;
  81. break;
  82. }
  83. frame.dispose();
  84.  
  85. }
  86.  
  87. });
  88.  
  89. frame.add(combo);
  90. frame.add(button);
  91. frame.setTitle("What Kind Of Fishing Would You Like To Do?");
  92.  
  93.  
  94. frame.pack();
  95. frame.setVisible(true);
  96. while(frame.isVisible()) {
  97. Time.sleep(250, 350);
  98. }
  99. this.timer = new Timer();
  100. this.FishExp = Skills.FISHING.getCurrentExp();
  101. return true;
  102. }
  103.  
  104. @Override
  105. public void MessageRecieved(MessageEvent message) {
  106. if (message.getMessage().contentEquals("You catch a karambwan."))
  107. Fish += 1;
  108. if (message.getMessage().contentEquals("You catch a rocktail."))
  109. Fish += 1;
  110. if (message.getMessage().contentEquals("You catch some karambwanji."))
  111. Fish += 20;
  112. if (message.getMessage().contentEquals("There") | message.getMessage().contentEquals("Bot") | message.getMessage().contentEquals("Sup") | message.getMessage().contentEquals("Teleported")) {
  113. Stop = true;
  114. }
  115. 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")) {
  116. Stop = true;
  117. }
  118. }
  119.  
  120.  
  121. @Override
  122. public void repaint(Graphics g) {
  123. final int FishesCaught = (int)(Fish * 3600000.0 / this.timer.getElapsed());
  124. final int FishXp = Skills.FISHING.getCurrentExp() - this.FishExp;
  125. final int FishXpHr = (int) (FishXp * 3600000.0D / this.timer.getElapsed());
  126. g.setColor(Color.white);
  127. g.drawString("Current Status: " + status, 15, 250);
  128. g.drawString("Time Running: " + this.timer.toElapsedString(), 15, 265);
  129. g.drawString("Fish Caught: " + Fish, 15, 280);
  130. g.drawString("Fish Caught (hr): " + NumberFormat.getNumberInstance(Locale.US).format(FishesCaught), 15, 295);
  131. g.drawString("Fishing Exp Gained: " + NumberFormat.getNumberInstance(Locale.US).format(FishXp), 15, 310);
  132. g.drawString("Fishing Exp (hr): " + NumberFormat.getNumberInstance(Locale.US).format(FishXpHr), 15, 325);
  133. g.drawString("Universal Fisher by Simmy", 160, 30);
  134. }
  135.  
  136. @Override
  137. public int loop() {
  138. //Add Variables Here;
  139. NPC RRSpot = NPCs.getNearest(8842);
  140. NPC RKSpot = NPCs.getNearest(1178);
  141. NPC KBSpot = NPCs.getNearest(1174);
  142. NPC Banker = NPCs.getNearest(494);
  143. NPC FSpots = NPCs.getNearest(1174, 1178, 8842);
  144. Item LVessel = Inventory.getItem(3159);
  145. Item VBait = Inventory.getItem(3150);
  146. Item RRSetup = Inventory.getItem(307, 15263);
  147. Item RKSetup = Inventory.getItem(3159, 3150);
  148. Item KBSetup = Inventory.getItem(303);
  149. GameObject ZRing1 = GameObjects.getNearest(14097);
  150. GameObject ZRing2 = GameObjects.getNearest(12128);
  151. GameObject Well = GameObjects.getNearest(26945);
  152.  
  153. if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & RKSpot != null & LVessel != null & VBait != null & RKFish == true & Stop == false) {
  154. status = "We Are Attempting To Fish Karambwans!";
  155. RKSpot.interact("Fish");
  156. Time.sleep(() -> Players.getMyPlayer().getAnimation() == 21193, 7500);
  157. }
  158. if (Players.getMyPlayer().getAnimation() == 21193 & Inventory.getFreeSlots() >= 1 & RKFish == true) {
  159. status = "We Are Currently Fishing Karambwans!";
  160. Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
  161. }
  162. if (Inventory.isFull() & Banker != null & Widgets.getOpenInterface() == -1 & RKFish == true) {
  163. status = "We Are Interacting With The Banker!";
  164. Banker.interact("Bank");
  165. Time.sleep(() -> Bank.isOpen(), 5500);
  166. }
  167. if (Inventory.isFull() & Widgets.getOpenInterface() == 5292 & RKFish == true) {
  168. status = "We Are Banking The Batch Of Karambwans!";
  169. Time.sleep(750, 800);
  170. Bank.deposit(3142, 27);
  171. Time.sleep(() -> Inventory.getFreeSlots() >= 1, 1250);
  172. }
  173. /* ^^^^ Fishing Karambwans Stage ^^^^^^ */
  174. if (KBSpot != null & Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & KBFish == true & KBWalk == false & Stop == false) {
  175. status = "We Are Attempting To Fish Karambwans Bait!";
  176. KBSpot.interact("Net");
  177. Time.sleep(() -> Players.getMyPlayer().getAnimation() == 20621, 5500);
  178. }
  179. if (KBSpot != null & Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & KBFish == true & KBWalk == true) {
  180. status = "We Are Walking To Fish Karambwans Bait Area!";
  181. Walking.walkTo(KBTile);
  182. Time.sleep(13500, 15000);
  183. KBWalk = false;
  184. }
  185. if (Players.getMyPlayer().getAnimation() == 20621 & Inventory.getFreeSlots() >= 1 & KBFish == true) {
  186. status = "We Are Currently Fishing Bait For Karambwans!";
  187. Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
  188. }
  189. /* ^^^^^^ Fishing Karambwan Bait Stage ^^^^^^ */
  190. if (Players.getMyPlayer().getAnimation() == -1 & Inventory.getFreeSlots() >= 1 & RRSpot != null & RRSetup != null & RRFish == true & Stop == false) {
  191. status = "We Are Attempting To Fish Rocktails!";
  192. RRSpot.interact("Bait");
  193. Time.sleep(() -> Players.getMyPlayer().getAnimation() == 622, 7500);
  194. }
  195. if (Players.getMyPlayer().getAnimation() == 622 & Inventory.getFreeSlots() >= 1 & RRFish == true) {
  196. status = "We Are Currently Fishing Rocktails!";
  197. Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 12500);
  198. }
  199. if (Inventory.isFull() & Banker != null & Widgets.getOpenInterface() == -1 & RRFish == true) {
  200. status = "We Are Interacting With The Banker!";
  201. Banker.interact("Bank");
  202. Time.sleep(() -> Bank.isOpen(), 5500);
  203. }
  204. if (Inventory.isFull() & Widgets.getOpenInterface() == 5292 & RRFish == true) {
  205. status = "We Are Banking The Batch Of Rocktails!";
  206. Time.sleep(750);
  207. Bank.deposit(15270, 27);
  208. Time.sleep(() -> Inventory.getFreeSlots() >= 1, 1250);
  209. }
  210. /* ^^^^^^ Fishing Rocktail Stage ^^^^^^ */
  211. if (KBSetup == null & RKSetup == null & RRSetup == null & Banker == null) {
  212. status = "We Are Teleporting Home!";
  213. Packets.sendAction(315, 2, -1, 30000);
  214. Time.sleep(() -> Banker == null, 10000);
  215. }
  216. if (KBSetup == null & RKSetup == null & RRSetup == null & Banker != null & Widgets.getOpenInterface() == -1) {
  217. status = "Attempting To Open The Bank!";
  218. Banker.interact("Bank");
  219. Time.sleep(() -> Widgets.getOpenInterface() == 5292, 7500);
  220. }
  221. if (KBSetup == null & KBFish == true & Widgets.getOpenInterface() == 5292) {
  222. status = "Attempting To Withdraw Bait Fishing Setup!";
  223. Time.sleep(1350, 1700);
  224. Bank.depositAll();
  225. Time.sleep(1350, 1700);
  226. Bank.withdraw(303, 1);
  227. Time.sleep(() -> KBSetup != null, 2000);
  228. }
  229. if (RKSetup == null & RKFish == true & Widgets.getOpenInterface() == 5292) {
  230. status = "Attempting To Withdraw Raw Karambwans Setup!";
  231. Time.sleep(1350, 1700);
  232. Bank.depositAll();
  233. Time.sleep(1350, 1700);
  234. Bank.withdraw(3159, 1);
  235. Time.sleep(1350, 1700);
  236. Bank.withdraw(3150, 50000);
  237. Time.sleep(() -> RKSetup != null, 2000);
  238. }
  239. if (RRSetup == null & RRFish == true & Widgets.getOpenInterface() == 5292) {
  240. status = "Attempting To Withdraw Rocktail Fishing Setup!";
  241. Time.sleep(1350, 1700);
  242. Bank.depositAll();
  243. Time.sleep(1350, 1700);
  244. Bank.withdraw(307, 1);
  245. Time.sleep(1350, 1700);
  246. Bank.withdraw(15263, 50000);
  247. Time.sleep(() -> RRSetup != null, 2000);
  248. }
  249. /* ^^^^^^ Dealing With Home Part & Banking ^^^^^ */
  250. if (ZRing1 != null & Well != null & FSpots == null) {
  251. status = "We Are Walking To Zanaris Fairyring!";
  252. ZRing1.interact("Use");
  253. Time.sleep(() -> ZRing1 == null, 7000);
  254. }
  255. if (ZRing2 != null & KBSpot == null & KBFish == true) {
  256. status = "Attempting To Teleport To Karambwans Bait Area!";
  257. ZRing2.interact("use");
  258. Time.sleep(3500, 4500);
  259. KeyBoard.typeWord("333", 225, true);
  260. Time.sleep(() -> ZRing2 == null, 7000);
  261. KBWalk = true;
  262. }
  263. if (ZRing2 != null & RKSpot == null & RKFish == true) {
  264. status = "Attempting To Teleport To Raw Karambwans Area!";
  265. ZRing2.interact("use");
  266. Time.sleep(3500, 4500);
  267. KeyBoard.typeWord("231", 225, true);
  268. Time.sleep(() -> ZRing2 == null, 8500);
  269. }
  270. if (RRSpot == null & RRFish == true) {
  271. status = "Attempting To Teleport To Rocktail Area!";
  272. Packets.sendAction(315, 4, -1, 27054);
  273. Time.sleep(() -> RRSpot != null, 7000);
  274. }
  275. if (Stop == true) {
  276. status = "Something/Someone Has Interrupted Us :(!";
  277. Time.sleep(125000, 150000);
  278. Stop = false;
  279. }
  280. /* ^^^^^ Teleporting Stages & AntiBan ^^^^^ */
  281. return 0;
  282. }
  283. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement