RangaLord243 2 Share Posted January 19, 2019 ~8 Hours Worth This Is My 2nd Script! It's An Efficient Iron Ore Miner Which Banks At Varrock West. 1. Start Script Near Varrock West Bank 2. $ Profit $ ► I Would Highly Recommend Enabling Breaks ◄ ● Ultra Sexy Paint/Crosshair Mouse ● Ore/GP Per Hour ● Human-Like Mouse/Camera Movement ● Random Conditional Sleeps Implemented ● Automatically Banks ► 1.0 - Initial Release - 19/01/2019 https://mega.nz/#!jnxHHKwZ!_xeLAlQHgZnk74oxBP-aNNAjH9wfVyKgXs28P42Hjvw Source Code: Quote package DBMiner; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.GameObject; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.widgets.message.Message; import java.awt.*; @ScriptManifest(category = Category.MINING, name = "DBMiner", author = "RangaLord243", version = 1.0) public class DBMiner extends AbstractScript { private long startTime; private int oreMined; Area bankArea = new Area(3185, 3444, 3180, 3443, 0); Area treeArea = new Area(3176, 3368, 3174, 3366, 0); @Override public void onStart() { startTime = System.currentTimeMillis(); log("Report Any Bugs On The Forum Thread."); getSkillTracker().start(); } public final String formatTime(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } @Override public void onMessage(Message message) { if (message.getMessage().contains("You manage to mine some iron")) { oreMined++; } } @Override public int onLoop() { if (!getInventory().isFull()) { if (treeArea.contains(getLocalPlayer())) { chopTree(); } else { if (getWalking().walk(treeArea.getRandomTile())) { sleep(Calculations.random(3000, 5500)); } } } if (getInventory().isFull()) { if (bankArea.contains(getLocalPlayer())) { bank(); } else { if (getWalking().walk(bankArea.getRandomTile())) { sleep(Calculations.random(3000, 6000)); } } } return 600; } @Override public void onExit() { log("Thankyou For Using DBMiner"); } @Override public void onPaint(Graphics2D g) { long runTime = System.currentTimeMillis() - startTime; g.setColor(Color.WHITE); g.drawString("Total Time: " + formatTime(runTime), 10, 30); g.drawString("Current level: " + getSkills().getRealLevel(Skill.MINING), 10, 45); g.drawString("Exp Gained: " + getSkillTracker().getGainedExperience(Skill.MINING), 10, 60); g.drawString("Exp Gained Per Hour: " + getSkillTracker().getGainedExperiencePerHour(Skill.MINING), 10, 75); g.drawString("Levels Gained: " + getSkillTracker().getGainedLevels(Skill.MINING), 10, 90); g.drawString("XP To Level: " + getSkills().getExperienceToLevel(Skill.MINING), 10, 105); g.drawString("Ores Mined: " + (oreMined), 10, 120); g.drawString("Ores To Level: " + getSkills().getExperienceToLevel(Skill.MINING) / 35, 10, 135); g.drawString("GP Earned: " + (oreMined) * 154, 10, 150); Point mP = getMouse().getPosition(); g.drawLine(mP.x, 0, mP.x, 1080); g.drawLine(0, mP.y, 1920, mP.y); } private void chopTree() { GameObject tree = getGameObjects().closest(n -> n.getID() == 7488); if (tree != null && tree.interact("Mine")) { int countLog = getInventory().count("Iron ore"); sleepUntil(() -> getInventory().count("Iron ore") > countLog, 12000); } } private void bank() { NPC banker = getNpcs().closest(npc -> npc != null && npc.hasAction("Bank")); if (banker != null && banker.interact("Bank")) { if (sleepUntil(() -> getBank().isOpen(), 9000)) { if (getBank().depositAllExcept(item -> item != null && item.getName().contains("pickaxe"))) { if (sleepUntil(() -> !getInventory().isFull(), 8000)) { if (getBank().close()) { sleepUntil(() -> !getBank().isOpen(), 8000); } } } } } } } Link to comment Share on other sites More sharing options...
andher 0 Share Posted May 5, 2020 how does it work? when I activate it, it takes him to the mining area, but then he does nothing, he just stays there Link to comment Share on other sites More sharing options...
salmqn 0 Share Posted May 14, 2020 Same thing as stated above ^ Link to comment Share on other sites More sharing options...
salmqn 0 Share Posted May 14, 2020 I found out how to fix, just change the ID of the iron ore, disregard my previous post. Link to comment Share on other sites More sharing options...
poonslayer420 0 Share Posted May 17, 2020 @salmqn what was the fix? can you tell me what you changed the ID to? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.