Advertisement
SimmysProjects

OakLarderMaker - Soulplay

Sep 1st, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 KB | None | 0 0
  1. import java.text.NumberFormat;
  2. import java.util.Locale;
  3. import java.awt.Color;
  4. import java.awt.Graphics;
  5. import xobot.script.wrappers.interactive.GameObject;
  6. import xobot.script.wrappers.interactive.Item;
  7. import xobot.script.wrappers.interactive.NPC;
  8. import xobot.script.methods.Widgets;
  9. import xobot.script.methods.input.KeyBoard;
  10. import xobot.script.methods.input.Mouse;
  11. import xobot.script.util.Time;
  12. import xobot.script.methods.Packets;
  13. import xobot.script.methods.tabs.Inventory;
  14. import xobot.script.methods.tabs.Skills;
  15. import xobot.script.methods.GameObjects;
  16. import xobot.script.methods.NPCs;
  17. import xobot.script.util.Timer;
  18. import xobot.script.Manifest;
  19. import xobot.client.callback.listeners.PaintListener;
  20. import xobot.script.ActiveScript;
  21.  
  22. @Manifest(authors = { "Simmy" }, name = "LarderMaker", description = "Will make diffrent kind of larders in your own house!")
  23. public class OakLarderMaker extends ActiveScript implements PaintListener
  24. {
  25. private Timer timer;
  26. private int ConExp;
  27. public static int Count = 0;
  28. public static int LardersMade = 0;
  29. public boolean Sent = false;
  30. String status;
  31.  
  32. public boolean onStart() {
  33. timer = new Timer();
  34. ConExp = Skills.CONSTRUCTION.getCurrentExp();
  35. status = "Loading Data..";
  36. return true;
  37. }
  38.  
  39. public int loop() {
  40. //Add Variables Here
  41. //Back Dialog: 4882 || Means Pay Butler
  42. GameObject Empty = GameObjects.getNearest(15403);
  43. GameObject Made = GameObjects.getNearest(13566);
  44. Item OakPlank = Inventory.getItem(8778);
  45. Item Saw = Inventory.getItem(8794);
  46. Item Hammer = Inventory.getItem(2347);
  47. NPC Butler = NPCs.getNearest(4243);
  48.  
  49. if (Saw != null & Hammer != null & OakPlank != null & Empty != null & Butler != null) {
  50. status = "Building The Larder!";
  51. Empty.interact("Build");
  52. Time.sleep(650, 850);
  53. Packets.sendAction(632, 8234, 0, 39601);
  54. Time.sleep(()-> Made != null , 1250);
  55. Sent = false;
  56. }
  57. if (Saw != null & Hammer != null & OakPlank != null & Made != null & Butler != null) {
  58. status = "Trying To Remove The Larder";
  59. Made.interact("Remove");
  60. Time.sleep(1700 , 1750);
  61. KeyBoard.typeWord("1", false);
  62. Time.sleep(1400 , 1750);
  63. LardersMade += 1;
  64. }
  65. if (Saw != null & Hammer != null & OakPlank == null & Butler != null & Widgets.getBackDialogId() == -1 || Widgets.getBackDialogId() == 2480 & Sent == false) {
  66. status = "Getting Banks From Plank!";
  67. Butler.interact("Fetch-from-bank");
  68. Time.sleep(() -> Widgets.getBackDialogId() == 2492, 1500);
  69. Packets.sendAction(315, 995, -1, 2495);
  70. Time.sleep(3500);
  71. KeyBoard.typeWord("24", 100, true);
  72. Time.sleep(3750);
  73. }
  74. if (Saw != null & Hammer != null & OakPlank == null & Butler == null & Made != null) {
  75. status = "Quickly Removing The Larder";
  76. Made.interact("Remove");
  77. Time.sleep(() -> Widgets.getBackDialogId() == 2459, 1000);
  78. KeyBoard.typeWord("1", false);
  79. Time.sleep(2750);
  80. LardersMade += 1;
  81. Sent = true;
  82. }
  83. if (Saw != null & Hammer != null & OakPlank == null & Butler == null & Made == null) {
  84. status = "We Are Waiting For The Butler!";
  85. Time.sleep(() -> Butler != null, 3500);
  86. }
  87. if (Saw != null & Hammer != null & OakPlank == null & Butler != null & Widgets.getBackDialogId() == 4882) {
  88. status = "Need To Pay The Butler!";
  89. Butler.interact("Talk-to");
  90. Time.sleep(2500);
  91. Packets.sendAction(679, 317, -17, 4886);
  92. Time.sleep(2500);
  93. KeyBoard.typeWord("1", 200, false);
  94. Time.sleep(2500);
  95. Butler.interact("Talk-to");
  96. Time.sleep(2500);
  97. KeyBoard.typeWord(" ", 200, false);
  98. Time.sleep(2500);
  99. }
  100. return 1;
  101. }
  102.  
  103. @Override
  104. public void repaint(final Graphics g) {
  105. final int lardersmade = (int)(LardersMade * 3600000.0 / this.timer.getElapsed());
  106. int ConExps = Skills.CONSTRUCTION.getCurrentExp() - ConExp;
  107. g.setColor(Color.white);
  108. g.drawString("Status: " + status, 15, 210);
  109. g.drawString("Runtime: " + this.timer.toElapsedString(), 15, 225);
  110. g.drawString("Larders Made: " + LardersMade, 15, 240);
  111. g.drawString("Larders(hr): " + NumberFormat.getNumberInstance(Locale.US).format(lardersmade), 15, 255);
  112. g.drawString("Construction Exp Gained: " + NumberFormat.getNumberInstance(Locale.US).format(ConExps), 15, 270);
  113. g.drawString("Larder Maker by Simmy", 15, 285);
  114. }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement