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.

2.3.11 #Settings.openHouseOptions() and setHouseBuildingMode(bool)

Featured Replies

- Not using mirror.

- Using the latest client.

- Probably caused by the toggle interface overhaul from a while back.

 

openHouseOptions() does nothing.

setHouseBuildingMode(bool) works but only when df4a25b9b1436bdb5791e4d2fd865c04.png is opened (something openHouseOptions does not do anymore).

 

#Settings.isHouseBuildingModeOn() works though.

 

What I tested against:

 if(!ctx.getSettings().isHouseBuildingModeOn()) {
            ctx.getSettings().openHouseOptions(); // Does not open the house options
            ctx.getSettings().setHouseBuildingMode(true); // Only works when manually opening house options context (or via a custom method)
  }

My fix:

private final Filter<RS2Widget> houseOptionTabFilter = w -> w != null && w.isVisible() && w.getMessage().equals("House Options");

private final Filter<RS2Widget> houseOptionButtonFilter = w -> w != null && w.isVisible() && w.getInteractActions() != null && Arrays.asList(w.getInteractActions()).contains("View House Options");

    private boolean isHouseOptionsOpen(){
        List<RS2Widget> results = ctx.getWidgets().filter(houseOptionTabFilter);
        return results != null && !results.isEmpty();
    }

    private boolean openHouseOptions(){
        if(isHouseOptionsOpen()) return true;
        if(!ctx.getTabs().getOpen().equals(Tab.SETTINGS)) {
            ctx.getTabs().open(Tab.SETTINGS);
        }
        List<RS2Widget> results = ctx.getWidgets().filter(houseOptionButtonFilter);
        if(results != null && !results.isEmpty()) {
            results.get(0).interact("View House Options");
        }
        return isHouseOptionsOpen();
    }

     if(!ctx.getSettings().isHouseBuildingModeOn()) {
            if(openHouseOptions()) {
                ctx.getSettings().setHouseBuildingMode(true);
            }
        }

I didn't use any fancy caching but the perhaps the filters will help you fix it more quickly peacerino ^^

Settings API is pretty jacked up at the moment. When I look at the API again (should be soon), it's already in my priority list. 

  • 2 weeks later...
Guest
This topic is now closed to further replies.

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.