Advertisement
Guest User

Untitled

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