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.

getWidgets().getWidgetContainingText() returning wrong widget

Featured Replies

  • Mirror client version v2.13.107
  • Console output / terminal output: None
  • Crash report if a crash occurred: None
  • Script that you ran: own script
  • Hooks that failed: None
  • JVM/Browser bit version (32 / 64): 64
Hey,

on my own green dragon killer script it supports looting bag. I'm using getWidget().getWidgetContainingText("All") to make sure the script deposits all items into the looting bag but for some reason when using the mirror client it always selectes the widget that contains ("One") and not ("All"). It works perfectly fine when running the same script on injection mode so I guess it has something to do with the mirror mode.

The method I'm using:

@Override    public boolean execute() throws InterruptedException {        Item i = sA.getInventory().getItem(new Filter<Item>() {            @Override            public boolean match(Item i) {                return i.getName().equalsIgnoreCase("Green dragonhide") || i.getName().equalsIgnoreCase("Dragon bones");            }        });        if(i != null && sA.getInventory().getAmount(i.getName()) > 2){            if(sA.getInventory().getItem(i.getName()).interact("Use"));{                new ConditionalSleep(2000, 100, 50) {                    @Override                    public boolean condition() throws InterruptedException {                        return sA.getInventory().isItemSelected();                    }                }.sleep();            }            if(sA.getInventory().isItemSelected()){                sA.getInventory().getItem("Looting bag").interact();                new ConditionalSleep(4000, 100, 50) {                    @Override                    public boolean condition() throws InterruptedException {                        return sA.getWidgets().getWidgetContainingText("All") != null;                    }                }.sleep();            }            if(sA.getWidgets().getWidgetContainingText("All") != null){                sA.getWidgets().getWidgetContainingText("All").interact("Continue");                sA.sleep(MethodProvider.random(600, 800));            }        }        return true;    }
Thanks for your time! :)

Edited by _Ace_

  • Author

Have you tried this in the injection client?

Yes and it worked perfectly fine

 

  • Mirror client version v2.0
  • Console output / terminal output: None
  • Crash report if a crash occurred: None
  • Script that you ran: own script
  • Hooks that failed: None
  • JVM/Browser bit version (32 / 64): 64

Hey, 

 

on my own green dragon killer script it supports looting bag. I'm using getWidget().getWidgetContainingText("All") to make sure the script deposits all items into the looting bag but for some reason when using the mirror client it always selectes the widget that contains ("One") and not ("All"). It works perfectly fine when running the same script on injection mode so I guess it has something to do with the mirror mode. 

 

The method I'm using:

@Override
    public boolean execute() throws InterruptedException {
        Item i = sA.getInventory().getItem(new Filter<Item>() {
            @Override
            public boolean match(Item i) {
                return i.getName().equalsIgnoreCase("Green dragonhide") || i.getName().equalsIgnoreCase("Dragon bones");
            }
        });
        if(i != null && sA.getInventory().getAmount(i.getName()) > 2){
            if(sA.getInventory().getItem(i.getName()).interact("Use"));{
                new ConditionalSleep(2000, 100, 50) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return sA.getInventory().isItemSelected();
                    }
                }.sleep();
            }
            if(sA.getInventory().isItemSelected()){
                sA.getInventory().getItem("Looting bag").interact();
                new ConditionalSleep(4000, 100, 50) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return sA.getWidgets().getWidgetContainingText("All") != null;
                    }
                }.sleep();
            }
            if(sA.getWidgets().getWidgetContainingText("All") != null){
                sA.getWidgets().getWidgetContainingText("All").interact("Continue");
                sA.sleep(MethodProvider.random(600, 800));
            }
        }
        return true;
    }

Thanks for your time! smile.png

 

 

The mirror client sometimes struggles with reading strings in dialogues. This is why it randomly gets stuck.

For example;

 

Ring of dueling teleports look like this -->

Duel Arena

Castle Wars

Clan Wars

 

The mirror client fails to do -->

dialogues.selectOption("Castle Wars");

so you need to do dialogues.selectOption(2);

 

so instead of trying to choose the option it should click with a string, select the option with its number.

  • Author

The mirror client sometimes struggles with reading strings in dialogues. This is why it randomly gets stuck.

For example;

Ring of dueling teleports look like this -->

Duel Arena

Castle Wars

Clan Wars

The mirror client fails to do -->

dialogues.selectOption("Castle Wars");

so you need to do dialogues.selectOption(2);

so instead of trying to choose the option it should click with a string, select the option with its number.

Thanks for the reply, choosing the widget by its root and child id works fine too? :)
  • Author

The problem is, when getting the widget by its root and child id, that it gets the wrong id when there are fewer options available in the looting bag option. So it would be A LOT easier to just use getWidgetContainingText.

Guest
This topic is now closed to further replies.

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.