Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Simple Miner


    sacred brids
     Share

    Recommended Posts

    Could someone guide me in the right direction of how to set a cluster area and only mine the 3 ores I choose in my script? Also to get the nearest deposit box and deposit all?

    Link to comment
    Share on other sites

    make an area

    define the 3 ores

    interact only if ore is in area

     

    make an area for depo box

    webwalk to area

    interact with box

    deposit all

    walk back to mine area

    Link to comment
    Share on other sites

    make an area

    define the 3 ores

    interact only if ore is in area

     

    make an area for depo box

    webwalk to area

    interact with box

    deposit all

    walk back to mine area

     

    Thank you so much. So basically I should just make all of these individual states and all interact with each other depending on the status of the state it is in?

    Link to comment
    Share on other sites

    Pseudo-coded but here

     

    Could someone guide me in the right direction of how to set a cluster area and only mine the 3 ores I choose in my script?

    Define an area to search for rocks in:

     

    Area miningArea = getLocalPlayer().getTile().getArea(10);

    or

    Area miningArea = new Tile(x, y).getArea(10);

    or

    Area miningArea = new Area( new Tile(x1, y1), new Tile(x2, y2) );

     

    (check javadocs to learn more about these things, but honestly if you understand what an Area is and the most basic API calls then it should be obvious)

     

    then filter the rocks to ensure it is a valid rock and is within our area

     

    GameObject rock = getGameObjects().getClosest(new Filter<GameObject>() {

        @override

        boolean match(GameObject obj) {

            return obj != null && obj.exists() && miningArea.contains(obj.getTile());

        }

    }

     

    Also to get the nearest deposit box and deposit all?

    //try to open the bank and if we do, deposit everything

    if (getBank().openBank()) {

        getBank().depositAll();

        getBank.close();

    } else {

        // otherwise we need to walk closer to the bank to be able to open it

        getWalking().walk(getBank().getClosestBank().getTile().getRandomArea(5));

    }

     

    there is a lot more that can be done but these are the basics.

    Link to comment
    Share on other sites

     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.