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.

Keyboard isn't pressing space instead going to next action.

Featured Replies

the keyboard isn't pressing space bar to make all instead it's using the items together, then just goes straight to backing stage.

 

if (getDialogues().isPendingContinuation()) {
    getKeyboard().pressKey(KeyEvent.VK_SPACE);
    int timeout = 1600; //2 tick surpassed + 400ms ping compensate
    int sleepTime = 700; //1 tick surpassed + 100ms ping compensate

    //sleep until isPendingContinuation() == false
    new ConditionalSleep(timeout, sleepTime) {
        @Override
        public boolean condition() throws InterruptedException {
            return !getDialogues().isPendingContinuation();
        }
    }.sleep();

    getKeyboard().releaseKey(KeyEvent.VK_SPACE);
new ConditionalSleep(16000, 19000) {
    @Override
    public boolean condition() {
        return inventory.getItem("The item I'm making").getAmount() == 28;
    }
}.sleep();

 

 

case 3: {
    log("Banking the items");
    if(!getBank().isOpen()){
        getBank().open();
        new ConditionalSleep(2500, 3000){
            @Override
            public boolean condition(){
                return getBank().isOpen();
            }
        }.sleep();
    }
    else {
        bank.depositAll();
        sleep(random(500,2000));
        Stage = 1;
        break;
    }
  • Author

Getting these errors in log, any help? [INFO][Bot #1][03/26 06:20:33 PM]: attempting to bank
[INFO][Bot #1][03/26 06:20:34 PM]: Attempting to make the items
[INFO][Bot #1][03/26 06:20:34 PM]: Banking the items
[ERROR][Bot #1][03/26 06:20:34 PM]: Error in script executor!
java.lang.NullPointerException
    at main.onLoop(main.java:128)
    at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(uk:63)
    at java.lang.Thread.run(Unknown Source)
[INFO][Bot #1][03/26 06:20:34 PM]: attempting to bank
[INFO][Bot #1][03/26 06:20:40 PM]: Bank Closed
[INFO][Bot #1][03/26 06:20:41 PM]: Attempting to make the items
[INFO][Bot #1][03/26 06:20:41 PM]: Dialog before it's shown
[INFO][Bot #1][03/26 06:20:46 PM]: Banking the items
[INFO][Bot #1][03/26 06:20:47 PM]: Attempting to make the items
[INFO][Bot #1][03/26 06:20:47 PM]: Dialog before it's shown

Also it's not getting past this part in the script but some how stage set's it self to 3. 

 

if (getDialogues().isPendingContinuation()) {
    log("Dialog after it's shown");
    getKeyboard().typeKey((char)32);
    log("Dialog after space");

    new ConditionalSleep(16000, 19000) {
        @Override
        public boolean condition() {
            log("Attempting to do conditional sleep");
            return inventory.getItem("The item im making").getAmount() == 28;
        }
    }.sleep();
    Stage = 3;
    break;
}

 

It's still entering stage 3 with this code. 

 

case 2: {
    log("Attempting to make the items");
    if (!inventory.isEmpty()) {
        if(inventory.contains("my item 1") && inventory.contains("my item 2")) {
            randomclicks = random(1,5);
            if(randomclicks < 3) {
                log("Dialog before it's shown");
                getInventory().interact("Use", "my item 2");
                sleep(random(1000, 3500));
                getInventory().interact("Use", "My item 1");
                sleep(random(500,2000));
                if (getDialogues().isPendingContinuation()) {
                    log("Dialog after it's shown");
                    getKeyboard().typeKey((char)32);
                    log("Dialog after space");

                    new ConditionalSleep(16000, 19000) {
                        @Override
                        public boolean condition() {
                            log("Attempting to do conditional");
                            return inventory.getItem("My item end").getAmount() == 28;
                        }
                    }.sleep();
                }
            }
            if(randomclicks >= 3) {
                log("Dialog before it's shown");
                getInventory().interact("Use", "my item 1");
                sleep(random(1000, 3500));
                getInventory().interact("Use", "my item 2");
                sleep(random(500,2000));
                if (getDialogues().isPendingContinuation()) {
                    log("Dialog after it's shown");
                    getKeyboard().typeKey((char)32);
                    log("Dialog after space");

                    new ConditionalSleep(16000, 19000) {
                        @Override
                        public boolean condition() {
                            log("Attempting to do conditional");
                            return inventory.getItem("My item end").getAmount() == 28;
                        }
                    }.sleep();
                }
            }
            else if(inventory.getItem("My item end").getAmount() == 28) {
                Stage = 3;
                break;
            }
        }
    }
}

Edited by Jueix

@Jueix If you're doing what I think you're doing the dialogue api won't work on a widget. Example the widget that pops up when making unfinished potions. So the if dialogue is pending is returning false.

EDIT: Reading the new post you made.

Edited by Gunman

  • Author
7 minutes ago, Gunman said:

@Jueix You had it right using the press and release


getKeyboard().pressKey(32);
getKeyboard().releaseKey(32);

I personally use the number^
But it said there was an NPE at line 128. What's line 128?

it was to bank the items in stage 3.

if(inventory.getItem("My item").getAmount() == 

if I do it this way

9 minutes ago, Gunman said:

@Jueix You had it right using the press and release


getKeyboard().pressKey(32);
getKeyboard().releaseKey(32);

I personally use the number^
But it said there was an NPE at line 128. What's line 128?

if i do it this way it works but interact's with the item and breaks the sleep / making of it.

 

log("Dialog before it's shown");
getInventory().interact("Use", "item 1");
sleep(random(1000, 3500));
getInventory().interact("Use", "item 2");
sleep(random(500,2000));
log("Dialog after it's shown");
sleep(random(500,2500));
getKeyboard().typeKey((char)32);
log("Dialog after space");

new ConditionalSleep(16000, 19000) {
    @Override
    public boolean condition() {
        log("Attempting to do conditional");
        return inventory.getItem("item 3").getAmount() == 28;
    }
}.sleep();

@Jueix Okay I see why it's going to stage 3. It's because the break; is inside the else if and the code isn't reaching that, so it continues to the next case. Now idk if anything else is broken in case 2 but that's why it's moving to case 3 regardless if it should or not.

  • Author
4 minutes ago, Gunman said:

@Jueix Okay I see why it's going to stage 3. It's because the break; is inside the else if and the code isn't reaching that, so it continues to the next case. Now idk if anything else is broken in case 2 but that's why it's moving to case 3 regardless if it should or not.

it's now not going to this code and checking if he has this amount in inventory before banking. 

 

else if(inventory.getItem("Item 3").getAmount() == 28) {
    Stage = 3;
    log("Attempting to go to stage 3");
}

@Jueix Does changing the if's like this fix that? Because it shouldn't go into the else if like you have it now if it already was inside the if before it.

if(randomclicks < 3) {
    //stuff
}
else if(randomclicks >= 3) {
  //stuff
}
if(inventory.getItem("My item end").getAmount() == 28) {
  //stuff
}
  • Author
20 minutes ago, Gunman said:

@Jueix Does changing the if's like this fix that? Because it shouldn't go into the else if like you have it now if it already was inside the if before it.


if(randomclicks < 3) {
    //stuff
}
else if(randomclicks >= 3) {
  //stuff
}
if(inventory.getItem("My item end").getAmount() == 28) {
  //stuff
}

Nope, but found away to make it work. My question though is if a skill level comes up with a while a sleep is going *My current conditional* Can I break the sleep to interact with the skill level and go back instead of waiting for the sleep to end then interact?

1 minute ago, Jueix said:

Nope, but found away to make it work. My question though is if a skill level comes up with a while a sleep is going *My current conditional* Can I break the sleep to interact with the skill level and go back instead of waiting for the sleep to end then interact?

Yeah, just use the or operator -> || and add another boolean to check if you leveled up

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.