Skip 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.

Toggling Roofs Hidden

Featured Replies

Alternative much simpler snippet provided by @Deceiver

getKeyboard().typeString("::toggleroofs");

 

 

If you still want to use the widget interaction way:

 

This makes use of my CachedWidget class: https://osbot.org/forum/topic/97399-a-better-way-to-handle-widgets-cachedwidget/

And also my WidgetActionFilter class: https://osbot.org/forum/topic/127248-widget-action-filter/

 

import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.event.Event;

public final class ToggleRoofsHiddenEvent extends Event {

    private final CachedWidget advancedOptionsWidget = new CachedWidget("Advanced options");
    private final CachedWidget displaySettingsWidget = new CachedWidget(new WidgetActionFilter("Display"));
    private final CachedWidget toggleRoofHiddenWidget = new CachedWidget(new WidgetActionFilter("Roof-removal"));

    @Override
    public final int execute() throws InterruptedException {
        if (Tab.SETTINGS.isDisabled(getBot())) {
            setFailed();
        } else if (getTabs().getOpen() != Tab.SETTINGS) {
            getTabs().open(Tab.SETTINGS);
        } else if (!advancedOptionsWidget.get(getWidgets()).isPresent()) {
            displaySettingsWidget.get(getWidgets()).ifPresent(widget -> widget.interact());
        } else if (!toggleRoofHiddenWidget.get(getWidgets()).isPresent()) {
            advancedOptionsWidget.get(getWidgets()).get().interact();
        } else if (toggleRoofHiddenWidget.get(getWidgets()).get().interact()) {
            setFinished();
        }
        return 200;
    }
}

 

Usage:

if (!getSettings().areRoofsEnabled()) {
    Event toggleRoofsHiddenEvent = new ToggleRoofsHiddenEvent();
    execute(toggleRoofsHiddenEvent);
}

 

Edited by Explv

look at daddy contributing to the community :ditto:

  • Author
On 05/08/2017 at 8:04 PM, Deceiver said:

getKeyboard().typeString("::toggleroofs", true);

Wow, TIL, I had no idea osrs had chatbox commands.

Thanks kiddo

29 minutes ago, Explv said:

Wow, TIL, I had no idea osrs had chatbox commands.

Thanks kiddo

ANYTHING TO MAKE YOU PROUD SENSEI 

  • Author
37 minutes ago, Alek said:

There's already a CachedWidget class that I wrote two years ago though?

There is, I just wanted to write it in my own style, without passing MethodProvider as a constructor argument, with a few extra constructors, and without having to explicitly call cache() before getWidget(). I could have just extended yours, but whatever.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.