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.enums.Skill;
- import impsoft.scripting.ibot.interfaces.AutoPaint;
- import impsoft.scripting.ibot.interfaces.ChatListener;
- import impsoft.scripting.types.ColorScript;
- import impsoft.utils.general.Timer;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.text.NumberFormat;
- import bergCoder.BergUtils;
- import bergCoder.Object3D;
- public class OmnisBetaIronlearner extends ColorScript implements AutoPaint,ChatListener{
- public OmnisBetaIronlearner(ColorBot arg0) {
- super(arg0);
- // TODO Auto-generated constructor stub
- }
- //*********************//
- /** Script Information */
- //********************//
- public static String name = "OmnisPowerIron";
- public static double version = 1.2;
- public static String author = "Omni";
- public static String description = "Powermines Iron" + version + ".";
- //******//
- //*Id's*//
- //******//
- 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};
- public final static int[] IRON_DEAD = {33402};
- public int ironanim = 624;
- BergUtils util = new BergUtils(this);
- String status = "";
- //***********//
- //Paint stuff//
- //***********//
- long scriptStartTIME = System.currentTimeMillis();
- public Timer Timer = new Timer(0);
- private int OresMined = 0;
- private int currentLvl = 0;
- private int startlvl = 0;
- private int currentxp = 0;
- private int startxp = 0;
- private int currentlvl = 0;
- public void script() throws InterruptedException, Exception {
- if (theLoggedInTest.isLoggedIn()) {
- int currentxp = theTabs.Statistics.getStatExperience(Skill.MINING);
- startxp = currentxp;
- currentlvl = theTabs.Statistics.getStatBottom(Skill.MINING);
- 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()) {
- int secondsTotal = (int) (Timer.getTimeElapsed()/1000);
- int seconds = secondsTotal%60;
- int minutes = (secondsTotal-seconds)/60;
- log("It took "+minutes+"mins "+seconds+"seconds to mine you a full inventory of Iron ore");
- int OresMined = theTabs.Inventory.count("Iron ore");
- 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);
- double averageCount = ((double) OresMined) * 3600 / (double) scriptStartTIME;
- double averageXP = ((double) (currentxp-startxp)) * 3600 / (double) scriptStartTIME;
- }
- g.setColor(Color.RED);
- g.drawString("Omnis Power Iron v " + version, 30, 14);
- g.drawString("Status: " + status, 30, 34);
- g.drawString("Run Time: " + hours + ":" + nf.format(minutes) + ":"
- + nf.format(seconds), 30, 54);
- g.drawString("Iron ores Mined:" + OresMined, 30, 74);
- g.drawString("Current level:" + currentLvl, 30, 94);
- g.drawString("Level: "+startlvl+"/"+currentlvl, 30, 114);
- g.drawString("Ore/hr "+nf.format(OresMined), 20, 100);
- g.drawString("XP "+(currentxp-startxp), 30, 115);
- g.drawString("XP/hr "+nf.format(currentxp), 30, 130);
- 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);
- }
- }
- public void chat(String arg0) throws InterruptedException {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement