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.

Script refusing to acknowledge the widget on screen

Featured Replies

I'm trying to make a flax bot, but it just refuses to acknowledge the "would you like to spin" widget on screen;

the code:

RS2Widget wouldyouliketospin = getWidgets().getWidgetContainingText("spin"); //spin
RS2Widget spin= getWidgets().get(270, 5);
if (getInventory().contains("Flax")) { //Does inventory contain flax?

    if (!Wheel_Area.contains(myPlayer())) { //Are we near the Spinning Wheel?
        log("In wheel area");

        if (wheel != null) { //Is the Spinning Wheel in clickable distance?
            wheel.interact("Spin"); //Spin boy
            new ConditionalSleep(5000){
                @Override
                public boolean condition(){
                    return myPlayer().isAnimating() || !wheel.exists();
                }
            }.sleep();

            log("Beginning to spin flax");

            if (spin != null) { //Choose Bowstring
            this.getKeyboard().typeKey('3');
                log("Spinning flax");

            } else {
                log("I broke");

All it does is return "I broke"; what am I doing wrong? I've tried putting in the widget id for the bowstring button as well, with no success

 

 

Thanks for your help

 

 

Ignore my awful coding btw thx

 

  • Author
9 minutes ago, Mysteryy said:

Are you sure you have the right id? Also, why do you have "RS2Widget wouldyouliketospin"  but not use that instead?

It was my first option, but didn't work so I tried the other way.  

is this the wrong one?

 

And i've tried 270,16 (white border around bow string) to no avail

image.png

Edited by hreyvirtue

8 minutes ago, hreyvirtue said:

It was my first option, but didn't work so I tried the other way.  

is this the wrong one?

 

And i've tried 270,16 (white border around bow string) to no avail

image.png

Well I'm at work at the moment, so I cant really try anything. 

But you might try like:

RS2Widget spin = getWidgets().getWidgetContainingText(270, "What would you like to spin?"); //spin
  • Author
2 minutes ago, Mysteryy said:

Well I'm at work at the moment, so I cant really try anything. 

But you might try like:


RS2Widget spin = getWidgets().getWidgetContainingText(270, "What would you like to spin?"); //spin

That worked,

thank you so much :3

9 minutes ago, hreyvirtue said:

That worked,

thank you so much :3

Yea also, try using 270, 3 instead of 270, 5.

Let me know if that works, just curious now.

 

 

Edit: I told pat (because I also saw this same problem the other day). For me I used the same thing that I suggested to you and it worked. He took a look and said that getWidgetContainingText(text) ignores chatbox. Its probably to avoid falsely matching text if a user says something. Like if a user says a message with the word "spin" in it, it would match that message when really you wanted the spinning widget, not a message from some random user where they said the word "spin". 

Edited by Mysteryy

  • Author
14 minutes ago, Mysteryy said:

Yea also, try using 270, 3 instead of 270, 5.

Let me know if that works, just curious now.

270, 3 didn't work 

1 minute ago, Malcolm said:

You don't even need to have the child widget here as you're using the keyboard to interact with the widget. 

so as long as widget 270 is visible you can just type 3.

Oooh, I see

Thanks <3

2 hours ago, Malcolm said:

You don't even need to have the child widget here as you're using the keyboard to interact with the widget. 

so as long as widget 270 is visible you can just type 3.

 

2 hours ago, hreyvirtue said:

270, 3 didn't work 

Oooh, I see

Thanks <3

 

Probably still want to make sure that the correct text is present.

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.