Jump to content

Oak & Bank


Imthabawse

Recommended Posts

Oak Woodcutter

- Cuts Oak's till full inventory and banks at Draynor Bank

- Will run away if attacked (Un-tested but should work)

- Informative paint 

 

To start script

- Have "Fixed mode" selected 

- Have zoom set to far left

- Axe in inventory OR wielding axe

- Start near Draynor (although not necessary as WebWalker should get you there)

- Enter Bank PIN prior to running so bot can Bank log's

 

Download

OaknBank

 

Source

Spoiler

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;


@ScriptManifest(author = "Imthabawse", info = "Chops and Banks Oak Logs", logo = "", name = "OaknBank", version = 1)

public class OaknBank extends Script {


    private Area oakArea = new Area(3085, 3305, 3077, 3291);



    @Override
    public int onLoop() throws InterruptedException {
        if(canCut()) {
            chopOaks();
        }else{
            bankLogs();
            underAttack();
        }
        return(random(500,550));
    }



    private void chopOaks() throws InterruptedException {
        RS2Object oakTree = getObjects().closest(oakArea, "Oak");

        if (readyToCut() && oakTree != null && oakTree.interact("Chop down")) {
                log("Chopping Oak!");
                sleep(random(750, 800));
                getMouse().moveOutsideScreen();
                new ConditionalSleep(5500) {
                    @Override
                    public boolean condition() {
                        return myPlayer().isAnimating();
                    }
                }.sleep();
            } else if (!oakArea.contains(myPlayer())) {
                log("Walking back to Oaks!");
                getWalking().webWalk(oakArea);
            }
        }



    private void bankLogs() throws InterruptedException {
        if(getInventory().isFull() && !myPlayer().isAnimating() && !Banks.DRAYNOR.contains(myPlayer())) {
            log("Walking to Bank!");
            getWalking().webWalk(Banks.DRAYNOR);
            new ConditionalSleep(2500) {
                @Override
                public boolean condition() {
                    return Banks.DRAYNOR.contains(myPlayer());
                }
            }.sleep();
        }else if(Banks.DRAYNOR.contains(myPlayer()) && getInventory().isFull() && !myPlayer().isUnderAttack() && !getBank().isOpen()) {
            log("Banking Logs!");
            getBank().open();
        }else if(getInventory().contains("Oak logs")) {
            getBank().depositAll("Oak logs");
        }else if(!getInventory().contains("Oak logs")) {
            getBank().close();
        }
    }


    private void underAttack() {
        if(myPlayer().isUnderAttack()) {
            log("Under attack! Running!");
            getWalking().webWalk(oakArea);
        }
    }


    private boolean canCut() {
        return !getInventory().isFull() && !getBank().isOpen();
    }
    private boolean readyToCut() {
        return !myPlayer().isAnimating() && !myPlayer().isUnderAttack() && oakArea.contains(myPlayer());
    }

}

 

Edited by Imthabawse
Fixed sloppy code
  • Like 1
  • Heart 1
Link to comment
Share on other sites

On 5/7/2019 at 12:35 PM, tmanowen said:

Would be awesome if u combined both scripts. Leveled from 1-20(or 15) then swapped to oaks and suicides

I can make this happen for sure.

Also no ban after running the 6 hours straight 🙂

Edit to above: Did receive perm ban couple days after suiciding account which was what I expected out of a test account (Fresh level 3 straight off tut island).

Edited by Imthabawse
Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...