Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BIGMining;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.map.Area;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.interactive.NPC;
- import org.dreambot.api.script.Category;
- @ScriptManifest(author = "JeremyFTW", name = "BIGMiner 1.1", version = 1.1, description = "Advanced Miner", category = Category.MINING)
- public class main extends AbstractScript {
- Area bankArea = new Area(3207, 3220, 3210, 3221, 2);
- Area oreArea = new Area(3232, 3152, 3220, 3142);
- private void idle() {
- sleep(250);
- }
- public void onStart() {
- log("Starting...");
- log("Welcome to BIGMiner, Version: 1.0");
- log("This Script is in early developement.");
- log("Please post any issues or questions on the forms!");
- log("This is a FREE version");
- }
- public void onExit() {
- log("Thank you for using my bots!");
- log("Exiting...");
- }
- @Override
- public int onLoop() {
- // mining ore
- if (getLocalPlayer().isAnimating()) {
- idle();
- } else if (!getInventory().isFull()) {
- if (oreArea.contains(getLocalPlayer())) {
- mineOre(11161); // change "Tree" to the name of your tree.
- log("Mining Ore");
- } else {
- if (getWalking().walk(oreArea.getRandomTile())) {
- log("walking to oreArea");
- sleep(Calculations.random(3000, 5500));
- }
- }
- }
- //banking
- if (getInventory().isFull()) { // it is time to bank
- if (bankArea.contains(getLocalPlayer())) {
- bank();
- } else {
- if (getWalking().walk(bankArea.getRandomTile())) {
- sleep(Calculations.random(3000, 6000));
- }
- }
- }
- return 0;
- }
- //mining ore function
- public void mineOre(int nameOfOre) {
- GameObject rocks = getGameObjects()
- .closest(gameObject -> gameObject != null && gameObject.getID() == nameOfOre);
- if (rocks != null) {
- rocks.interact("Mine");
- sleepUntil(() -> getLocalPlayer().isAnimating(), 5000);
- }
- }
- //banking function
- public 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);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement