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.

Oak Doors ;)

Featured Replies

Hello again and welcome back to Oak Doors V2 this time around I've implemented only ConditionalSleeps seems to run pretty smooth.

To start it you need:

- Saw/Crystal Saw

- Hammer

- Nails

- Demon butler (Servant)

- Have his task set to withdraw (20) oak planks from bank

- Start script in player owned dungeon (Single room)

- Call Servant at least once before starting script

- Money bag with money in it (preferably 500k+ for longer runs)

- Have Build mode ON

Once all these have been met start script and sit back and enjoy the levels :)

Thing's to improve

- Interact with Butler before completely out of Oak planks so constantly building/removing and having butler fetch planks (Faster EXP rates)

I know about the && operator as well so don't hate just how I like to write for time being. ?

All feedback both Negative && Positive are welcome. Code below. ?

 

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;


@ScriptManifest(name = "Perfect Doors", logo = "", version = 1, author = "Imthabawse", info = "Makes Oak doors, calls for butler to get planks from bank.")



public class PerfectDoors extends Script {


    // To start script: 1. Building mode ON 2. Oak planks in bank 3. Have Hammer, Saw, Nails in inventory

// oak door area

// butler area

    // build/remove code
    private void build() {

        if (getInventory().getAmount("Oak plank") >= 10) {
            if (!myPlayer().isAnimating()) {
                if (!myPlayer().isMoving()) {
                    RS2Object doorSpace = getObjects().closest("Door space");
                    log("Getting Door space..");
                    if (doorSpace != null) {
                        RS2Object builtdoor = getObjects().closest("Door");
                        if(builtdoor == null) {
                            doorSpace.interact("Build");
                            log("Interacting with Door space.");
                            new ConditionalSleep(2000) {
                                @Override
                                public boolean condition() {
                                    return getWidgets().getWidgetContainingText("Furniture Creation Menu") != null;
                                }
                            }.sleep();
                            RS2Widget oakDoor = getWidgets().get(458, 4, 4);
                            if (oakDoor != null) {
                                oakDoor.interact();
                                log("Building..");
                                new ConditionalSleep(2000) {
                                    @Override
                                    public boolean condition() {
                                        return myPlayer().isAnimating();
                                    }
                                }.sleep();
                            }
                        }
                    }
                }
            }
        }
    }

    private void remove() {
        RS2Object door = getObjects().closest("Door");
        log("Getting Door");
        if (door != null) {
            if (!myPlayer().isAnimating()) {
                door.interact("Remove");
                log("Interacting with Door.");
                new ConditionalSleep(2000) {
                    @Override
                    public boolean condition() {
                        return getWidgets().getWidgetContainingText("Really remove it?") != null;
                    }
                }.sleep();
                RS2Widget yes = getWidgets().getWidgetContainingText("Yes");
                if (yes != null) {
                    if (!myPlayer().isAnimating()) {
                        yes.interact();
                        log("Removing Door..");
                        new ConditionalSleep(2000) {
                            @Override
                            public boolean condition() {
                                return myPlayer().isAnimating();
                            }
                        }.sleep();
                    }
                }
            }
        }
    }
    // butler code
    private void butler() throws InterruptedException {
        if (getInventory().getAmount("Oak plank") < 10) {
            if (!myPlayer().isAnimating()) {
                NPC demonbutler = getNpcs().closest("Demon butler");
                log("Getting butler..");
                if (demonbutler != null) {
                    demonbutler.interact("Talk-to");
                    log("Interacting with butler.");
                    new ConditionalSleep(2000) {
                        @Override
                        public boolean condition() {
                            return getWidgets().getWidgetContainingText("Repeat last task?") != null;
                        }
                    }.sleep();
                    RS2Widget fetch = getWidgets().getWidgetContainingText("Fetch from bank: 20 x Oak plank");
                    if (fetch != null) {
                        fetch.interact();
                        log("Waiting on planks to build..");
                        sleep(random(300, 600));
                        getMouse().moveOutsideScreen();
                        new ConditionalSleep(7200) {
                            @Override
                            public boolean condition() {
                                return getInventory().getAmount("Oak plank") >= 10;
                            }
                        }.sleep();
                    }
                }
            }
        }
    }




    @Override
    public int onLoop() throws InterruptedException {
        if(myPlayer().getAnimation() < 1) {
            build();
            remove();
            butler();
        }

        return 1500;
    }
}

 

Edited by Imthabawse

Try cleaning it up some. Makes debugging/improving 100x easier.

  • Author

Might have fixed..Got rid of area and added:

RS2Object builtdoor = getObjects().closest("Door");
                        if(builtdoor == null) {
                            doorSpace.interact("Build");

into the Build() method. Seems to be working so far as always can use tweaks here and there.

Will edit code in original post to working version.

Edited by Imthabawse

  • Author
6 hours ago, kristapsss said:

demon change location's all the time.

I have a single dungeon room which is small enough that .closest works just fine. Ran it for bout an hour straight no issues.

Create an account or sign in to comment

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.