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.

Widgets Issue

Featured Replies

Hello guys, I'm trying to make a Al-Kharid Smelting bars script.

 

One problem that I am having is that my script won't use the widgets. 

 

RS2Widget bronze = getWidgets().get(311, 4);

if (bronze != null){
                        bronze.interact("Smelt X Bronze");
                        getKeyboard().typeString("" + (int)((Math.random()*99) + 30));
                    }

I also tried RS2Widget bronze = getWidgets().getWidgetContainingText("Bronze") which also doesn't work.

How come this code doesn't work?

The code before this interacts with the furnace then the bar options pop up and then the script does nothing.

 

Image: http://imgur.com/IYd0exp

 

Edited by ElloPOPz

  • Author

Nope does not work

Here's my code for the widget:
 

RS2Widget bronze = getWidgets().getWidgetContainingText("Bronze");

furnace.interact("Smelt");
                    if (bronze != null){
                        bronze.interact("Smelt X");

                    }


RS2Widget bronze = getWidgets().getWidgetContainingText("Bronze");

                    if (bronze != null){

                        bronze.interact("Smelt X");

                    } else {

furnace.interact("Smelt");

}

  • Author

It doesn't work still

 

Here's my code for traveling from bank to smelting place and smelting the bars

 

RS2Object furnace = objects.closest("Furnace");
        RS2Object bank = objects.closest("Bank booth");
        RS2Widget bronze = getWidgets().getWidgetContainingText("Bronze");
        final Area FURNACE_AREA = new Area(3274, 3184, 3279, 3188);
        final Area BANK_AREA = new Area(3269, 3166, 3271, 3169);
        
            if (!FURNACE_AREA.contains(myPlayer())){
                getWalking().walk(FURNACE_AREA.getRandomPosition());
                if (!myPlayer().isAnimating()){
                    if (bronze != null){
                        bronze.interact("Smelt X");
                        getKeyboard().typeString("" + (int)((Math.random()*99) + 30));
                    } else
                        furnace.interact("Smelt");
                }
            }

your logic is really bad :E

there's a check if player is not in furnace area and there's an interact with furnace in there too.

RS2Object furnace = objects.closest("Furnace");
        RS2Object bank = objects.closest("Bank booth");
        RS2Widget bronze = getWidgets().getWidgetContainingText("Bronze");
        final Area FURNACE_AREA = new Area(3274, 3184, 3279, 3188);
        final Area BANK_AREA = new Area(3269, 3166, 3271, 3169);
        
            if (!FURNACE_AREA.contains(myPlayer())) {
                getWalking().walk(FURNACE_AREA.getRandomPosition());
               } else {
                    if (bronze != null) {
                        bronze.interact("Smelt X");
                        sleep(1250);
                        getKeyboard().typeString("" + (int)((Math.random()*99) + 30));
                        new ConditionalSleep(150_000) {
                        @Override
                         public boolean condition() throws InterruptedException {
                           return !getInventory().contains("Tin ore");
                            }
                         }.sleep();
                      } else {
                        furnace.interact("Smelt");
                         new ConditionalSleep(5_000) {
                        @Override
                       public boolean condition() throws InterruptedException {
                         return bronze != null;
                     }
                 }.sleep();
                }
            }

Edited by Acerd

  • Author

Yeah... this is my first script I'm writing. Trying to learn how to script ;)

btw these errors pop up

 

ConditionalSleep cannot be resolved to a type

 

the method condition() of  type new ConditionSleep(){} must override or implement a supertype method

 

What do they mean?

 

Thanks for helping

Yeah... this is my first script I'm writing. Trying to learn how to script wink.png

btw these errors pop up

 

ConditionalSleep cannot be resolved to a type

 

the method condition() of  type new ConditionSleep(){} must override or implement a supertype method

 

What do they mean?

 

Thanks for helping

import conditionalSleep

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.