Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. import impsoft.bots.ColorBot;
  2. import impsoft.scripting.ibot.builtin.itemrec.InventoryReflectionItemSlot;
  3. import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
  4. import impsoft.scripting.ibot.interfaces.AutoPaint;
  5. import impsoft.scripting.types.ColorScript;
  6. import impsoft.utils.general.Timer;
  7. import impsoft.values.constant.Areas;
  8.  
  9. import java.awt.Color;
  10. import java.awt.Graphics;
  11. import java.text.NumberFormat;
  12.  
  13. import bergCoder.BergUtils;
  14. import bergCoder.Object3D;
  15.  
  16. public class OmnisBetaIron extends ColorScript implements AutoPaint {
  17.  
  18. public OmnisBetaIron(ColorBot arg0) {
  19. super(arg0);
  20. // TODO Auto-generated constructor stub
  21. }
  22.  
  23. /** Script Information */
  24. public static String name = "OmnisPowerIron"; //What shows up on nexus scripts folder name.
  25. public static double version = 1.1; //Version number
  26. public static String author = "Omni"; //Authors name here
  27. public static String description = "Powermines Iron" + version + "."; //Description nexus will give in scripts folder.
  28.  
  29. public final static int[] IRON = {2092, 2093, 5773, 5774, 5775, 9717, 9718, 9719, 11557, 11954, 11955, 11956, 14913, 14914, 31071, 31072, 31073, 37307, 37308, 37309}; //how the script knows what its after.
  30. public final static int[] IRON_DEAD = {33402};//The rock without any Minable iron in it.
  31. public int ironanim = 624; //The animation that your player makes while mining.
  32. BergUtils util = new BergUtils(this); //tells the script to run uber utils?
  33.  
  34. String status = "";
  35.  
  36. long scriptStartTIME = System.currentTimeMillis();
  37. public Timer Timer = new Timer(0);
  38.  
  39. public void script() throws InterruptedException, Exception {
  40. if (theLoggedInTest.isLoggedIn()) {
  41. log("Omni's Iron Powerminer Begun");
  42. log("Please post any bug reports on the forums.");
  43. while(hasPickaxe()){
  44. mine();
  45. sleep(10, 20); //Avoiding any stack overloading
  46. }
  47. shutDown();
  48. }
  49. }
  50.  
  51. public void mine() throws InterruptedException {
  52. status = "Mining";
  53. util.clickInteractiveObject(IRON, null, null, "ine rock",
  54. new Object3D(30,-48,36,-30,-47,50, false));
  55. util.waitForNoAnimation();
  56. if(theTabs.Inventory.isFull())
  57. drop();
  58.  
  59. }
  60. public void drop() throws InterruptedException
  61. {
  62. if(!theTabs.Inventory.isSelected())
  63. {
  64. theTabs.Inventory.setSelected();
  65. }
  66.  
  67. for(InventoryReflectionItemSlot s : theTabs.Inventory.SLOTS)
  68. {
  69. ItemSlot is = theTabs.Inventory.findItemSlot("ron ore");
  70. if(s.getItemName().equals("Iron ore"))
  71. {
  72. is.mouseClickRightOn();
  73. while(!theMenuFinder.isMenuUp())
  74. {
  75. sleep(10,20);
  76. }
  77. if(theMenuFinder.isMenuUp())
  78. {
  79. theMenuFinder.doMenu("drop");
  80. sleep(50,100);
  81. }
  82. }
  83. }
  84. log("Dropping Complete");
  85. }
  86.  
  87. public boolean hasPickaxe() throws InterruptedException {
  88. return theTabs.Inventory.count("ickaxe") > 0 || theTabs.Equipment.isWearing("ickaxe");
  89. }
  90.  
  91. public void paint(Graphics g) {
  92. long runTime = 0;
  93. long seconds = 0;
  94. long minutes = 0;
  95. long hours = 0;
  96. final NumberFormat nf = NumberFormat.getInstance();
  97. nf.setMinimumIntegerDigits(2);
  98. runTime = System.currentTimeMillis() - scriptStartTIME;
  99. seconds = runTime / 1000;
  100. if (seconds >= 60) {
  101. minutes = seconds / 60;
  102. seconds -= (minutes * 60);
  103. }
  104. if (minutes >= 60) {
  105. hours = minutes / 60;
  106. minutes -= (hours * 60);
  107. }
  108. g.setColor(Color.RED);
  109. g.drawString("OmnisIron v " + version, 19, 14);
  110. g.drawString("Status: " + status, 19, 34);
  111. g.drawString("Run Time: " + hours + ":" + nf.format(minutes) + ":"
  112. + nf.format(seconds), 19, 54);
  113. if (util.target != null && util.targetTimer.isNotUp()) {
  114. g.drawPolygon(util.target);
  115. }
  116. if (util.targetPoint != null && util.targetTimer.isNotUp()) {
  117. g.drawString("Mine This Bitch!", util.targetPoint.x,
  118. util.targetPoint.y);
  119.  
  120. }
  121. }
  122.  
  123.  
  124. Thread BradAnti = new Thread() {
  125. public void run() {
  126. setName("Brad Anti-Ban Thread");
  127. setPriority(1);
  128. log("AntiBan Thread started");
  129. Timer AntiBanTimer = new Timer(random(90000, 190000));
  130. while (true) {
  131. try {
  132. if (AntiBanTimer.isUp()) {
  133. int CaveSwitch = random(1, 6);
  134. switch (CaveSwitch) {
  135. case 1:
  136. theCamera.setYawRandom();
  137. log("[Anti-Ban] Random compass rotation");
  138. sleep(random(800, 900));
  139. break;
  140. case 2:
  141. mouseMove(Areas.ENTIRE);
  142. log("[Anti-Ban] Mouse movement");
  143. log("Mouse was moved to " + getCurrentMouseXY());
  144. sleep(random(800, 900));
  145. break;
  146. case 3:
  147. TabSkelton();
  148. log("[Anti-Ban] Tabs");
  149. sleep(random(800, 900));
  150. break;
  151. case 4:
  152. mouseClickRight(Areas.GAME);
  153. log("[Anti-Ban] Random Right Click");
  154. int r = random(1, 5);
  155. {
  156. if (r == 2) {
  157. theMenuFinder.doMenu("here");
  158. } else if (r == 3) {
  159. theMenuFinder.doMenu("ancel");
  160. } else {
  161. log("Leaving the right click along");
  162. }
  163. }
  164. sleep(random(800, 900));
  165. break;
  166. case 5:
  167. theCamera.setYawRandom();
  168. log("[Anti-Ban] Random Compass rotation");
  169. sleep(random(800, 900));
  170. break;
  171. case 6:
  172. theCamera.setYawRandomNormal();
  173. log("[Anti-Ban] Random Compass rotation");
  174. break;
  175. case 7:
  176. theCamera.setYawRandom();
  177. log("[Anti-Ban] Random compass rotation");
  178. break;
  179. case 8:
  180. mouseMove(Areas.GAME);
  181. if (theTopText.isTopTextContaining("level")) {
  182. mouseClickRight(getCurrentMouseXY());
  183. log("We found a player or an NPC. Right clicked");
  184. }
  185. log("[Anti-Ban] Mouse Movement. Mouse was moved to: "
  186. + getCurrentMouseXY());
  187. }
  188. AntiBanTimer.reset();
  189. }
  190. sleep(random(300, 2000));
  191. } catch (InterruptedException e) {
  192. info("Thread stopped");
  193. break;
  194. }
  195. }
  196. }
  197. };
  198.  
  199. public void TabSkelton() throws InterruptedException {
  200. impsoft.scripting.ibot.builtin.tabs.TabSkelton[] tabs = {
  201. theTabs.Attack, theTabs.Friends, theTabs.Equipment,
  202. theTabs.Attack, theTabs.Music, theTabs.Prayer, theTabs.Ignore,
  203. theTabs.Options, theTabs.Magic, theTabs.Quest,
  204. theTabs.Statistics, theTabs.Inventory };
  205. int BradRandom = random(0, 11);
  206. int BradRandom2 = random(0, 10);
  207. if (BradRandom <= 5) {
  208. tabs[BradRandom].setSelected();
  209. } else {
  210. tabs[BradRandom2].click();
  211. }
  212. }
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement