Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import impsoft.bots.ColorBot;
- import impsoft.scripting.ibot.builtin.itemrec.InventoryReflectionItemSlot;
- import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
- import impsoft.scripting.ibot.interfaces.AutoPaint;
- import impsoft.scripting.types.ColorScript;
- import impsoft.utils.general.Timer;
- import impsoft.values.constant.Areas;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.text.NumberFormat;
- import bergCoder.BergUtils;
- import bergCoder.Object3D;
- public class OmnisBetaIron extends ColorScript implements AutoPaint {
- public OmnisBetaIron(ColorBot arg0) {
- super(arg0);
- // TODO Auto-generated constructor stub
- }
- /** Script Information */
- public static String name = "OmnisPowerIron"; //What shows up on nexus scripts folder name.
- public static double version = 1.1; //Version number
- public static String author = "Omni"; //Authors name here
- public static String description = "Powermines Iron" + version + "."; //Description nexus will give in scripts folder.
- 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.
- public final static int[] IRON_DEAD = {33402};//The rock without any Minable iron in it.
- public int ironanim = 624; //The animation that your player makes while mining.
- BergUtils util = new BergUtils(this); //tells the script to run uber utils?
- String status = "";
- long scriptStartTIME = System.currentTimeMillis();
- public Timer Timer = new Timer(0);
- public void script() throws InterruptedException, Exception {
- if (theLoggedInTest.isLoggedIn()) {
- log("Omni's Iron Powerminer Begun");
- log("Please post any bug reports on the forums.");
- while(hasPickaxe()){
- mine();
- sleep(10, 20); //Avoiding any stack overloading
- }
- shutDown();
- }
- }
- public void mine() throws InterruptedException {
- status = "Mining";
- util.clickInteractiveObject(IRON, null, null, "ine rock",
- new Object3D(30,-48,36,-30,-47,50, false));
- util.waitForNoAnimation();
- if(theTabs.Inventory.isFull())
- drop();
- }
- public void drop() throws InterruptedException
- {
- if(!theTabs.Inventory.isSelected())
- {
- theTabs.Inventory.setSelected();
- }
- for(InventoryReflectionItemSlot s : theTabs.Inventory.SLOTS)
- {
- ItemSlot is = theTabs.Inventory.findItemSlot("ron ore");
- if(s.getItemName().equals("Iron ore"))
- {
- is.mouseClickRightOn();
- while(!theMenuFinder.isMenuUp())
- {
- sleep(10,20);
- }
- if(theMenuFinder.isMenuUp())
- {
- theMenuFinder.doMenu("drop");
- sleep(50,100);
- }
- }
- }
- log("Dropping Complete");
- }
- public boolean hasPickaxe() throws InterruptedException {
- return theTabs.Inventory.count("ickaxe") > 0 || theTabs.Equipment.isWearing("ickaxe");
- }
- public void paint(Graphics g) {
- long runTime = 0;
- long seconds = 0;
- long minutes = 0;
- long hours = 0;
- final NumberFormat nf = NumberFormat.getInstance();
- nf.setMinimumIntegerDigits(2);
- runTime = System.currentTimeMillis() - scriptStartTIME;
- seconds = runTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= (minutes * 60);
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= (hours * 60);
- }
- g.setColor(Color.RED);
- g.drawString("OmnisIron v " + version, 19, 14);
- g.drawString("Status: " + status, 19, 34);
- g.drawString("Run Time: " + hours + ":" + nf.format(minutes) + ":"
- + nf.format(seconds), 19, 54);
- if (util.target != null && util.targetTimer.isNotUp()) {
- g.drawPolygon(util.target);
- }
- if (util.targetPoint != null && util.targetTimer.isNotUp()) {
- g.drawString("Mine This Bitch!", util.targetPoint.x,
- util.targetPoint.y);
- }
- }
- Thread BradAnti = new Thread() {
- public void run() {
- setName("Brad Anti-Ban Thread");
- setPriority(1);
- log("AntiBan Thread started");
- Timer AntiBanTimer = new Timer(random(90000, 190000));
- while (true) {
- try {
- if (AntiBanTimer.isUp()) {
- int CaveSwitch = random(1, 6);
- switch (CaveSwitch) {
- case 1:
- theCamera.setYawRandom();
- log("[Anti-Ban] Random compass rotation");
- sleep(random(800, 900));
- break;
- case 2:
- mouseMove(Areas.ENTIRE);
- log("[Anti-Ban] Mouse movement");
- log("Mouse was moved to " + getCurrentMouseXY());
- sleep(random(800, 900));
- break;
- case 3:
- TabSkelton();
- log("[Anti-Ban] Tabs");
- sleep(random(800, 900));
- break;
- case 4:
- mouseClickRight(Areas.GAME);
- log("[Anti-Ban] Random Right Click");
- int r = random(1, 5);
- {
- if (r == 2) {
- theMenuFinder.doMenu("here");
- } else if (r == 3) {
- theMenuFinder.doMenu("ancel");
- } else {
- log("Leaving the right click along");
- }
- }
- sleep(random(800, 900));
- break;
- case 5:
- theCamera.setYawRandom();
- log("[Anti-Ban] Random Compass rotation");
- sleep(random(800, 900));
- break;
- case 6:
- theCamera.setYawRandomNormal();
- log("[Anti-Ban] Random Compass rotation");
- break;
- case 7:
- theCamera.setYawRandom();
- log("[Anti-Ban] Random compass rotation");
- break;
- case 8:
- mouseMove(Areas.GAME);
- if (theTopText.isTopTextContaining("level")) {
- mouseClickRight(getCurrentMouseXY());
- log("We found a player or an NPC. Right clicked");
- }
- log("[Anti-Ban] Mouse Movement. Mouse was moved to: "
- + getCurrentMouseXY());
- }
- AntiBanTimer.reset();
- }
- sleep(random(300, 2000));
- } catch (InterruptedException e) {
- info("Thread stopped");
- break;
- }
- }
- }
- };
- public void TabSkelton() throws InterruptedException {
- impsoft.scripting.ibot.builtin.tabs.TabSkelton[] tabs = {
- theTabs.Attack, theTabs.Friends, theTabs.Equipment,
- theTabs.Attack, theTabs.Music, theTabs.Prayer, theTabs.Ignore,
- theTabs.Options, theTabs.Magic, theTabs.Quest,
- theTabs.Statistics, theTabs.Inventory };
- int BradRandom = random(0, 11);
- int BradRandom2 = random(0, 10);
- if (BradRandom <= 5) {
- tabs[BradRandom].setSelected();
- } else {
- tabs[BradRandom2].click();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement