Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[PortKhazard] IronBanker

Featured Replies

Version 0.2:

Start pickaxe equipped

Iron rocks North of Yanille Bank

 

Source:

package org.acinate.scripts.Mining;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Area;



@ScriptManifest(name="PortKMiner", author ="Acinate", info="Mines iron", version=0.1, logo="Mining")
public class PortKhazardMiner extends Script {

    private State state = State.IDLE;
    private Area MINE = new Area(2627,3141,2627,3140);
    private Area BANK = new Area(2662,3162,2664,3160);


    private Area iR1 = new Area(2627,3142,2627,3142);
    private Area iR2 = new Area(2628,3141,2628,3141);
    private Area iR3 = new Area(2628,3140,2628,3140);
    private final int dB = 11747;
    private final int iR = 13711;

    public void onStart() {this.log("Script has begun!");}

    public int onLoop() throws InterruptedException {
        switch (state = getState()) {
            case CONTINUE:
                getDialogues().clickContinue();
            case IDLE:
                onLost();
            case MINE:
                log("MINE:");
                Entity ironRock1 = getObjects().closest(iR1, iR);
                Entity ironRock2 = getObjects().closest(iR2, iR);
                Entity ironRock3 = getObjects().closest(iR3, iR);

                int cameraPitch = getCamera().getPitchAngle();
                if (cameraPitch < 50) {
                    getCamera().movePitch(80);
                }

                if (!getInventory().isFull()) {
                    if (myPlayer().getInteracting() == null) {
                        if (ironRock1 != null) {
                            ironRock1.interact("Mine");
                            log("Mining 1");
                            sleep(random.nextInt(500) + -100);
                        } else {
                            ironRock2.interact("Mine");
                            log("Mining 2");
                            sleep(random.nextInt(500) + -100);
                        }
                        if (ironRock3 != null && ironRock1 == null && ironRock2 == null) {
                            ironRock3.interact("Mine");
                            log("Mining 3");
                            sleep(random.nextInt(500) + -100);
                        }
                    }
                } else {
                    getLocalWalker().walk(BANK,true);
                }

                break;
            case BANK:
                log("BANK:");
                Entity depositBox = getObjects().closest(dB);
                if (!getInventory().isEmpty()) {
                    if (!getDepositBox().isOpen() && depositBox != null) {
                        depositBox.interact("Deposit");
                        getDepositBox().close();
                    } else {
                        getDepositBox().depositAll();
                    }
                } else {
                    getLocalWalker().walk(MINE,true);
                }

        }
        return random.nextInt(500) +- 100;
    }

    private State getState()
    {
        if (getDialogues().isPendingContinuation())
            return state.CONTINUE;
        if (BANK.contains(myPlayer()))
            return state.BANK;
        if (MINE.contains(myPlayer()))
            return state.MINE;
        return State.IDLE;
    }

    public enum State{CONTINUE, IDLE, MINE, BANK}

    public void onLost() {
        log("onLost()");
        if (getInventory().isFull() && !BANK.contains(myPlayer())) {
            getLocalWalker().walk(BANK,true);
            log("onLost(BANK)");
        }

        if (!getInventory().isFull() && !MINE.contains(myPlayer())) {
            getLocalWalker().walk(MINE,true);
            log("onLost(MINE)");
        }
    }
    public void onExit() {

    }
}

 

Need help with:

-Trying to use .prioritized to mine rocks in order

- != null detection seems not to work 100% with rocks

Edited by Acinate

Im sure the script is good :3 , another script writer you help you out with those problems im sure :)

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.