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.

NPC Dialog issue!

Featured Replies

Hi! 

I am new to this forum and new to scripting. I am in scripting progress and I came with an issue where I am stuck. Usually I just google for answers but now even google can't help me.

 

I am trying to make my bot to talk with NPC but it just gets stuck after it presses space when it just starts talking. And it looks like that script is going through all lines as it returns all log

here is my part of script I am having issues with. 

 

if (widgets.get(231, 2) != null) {
                log("vin1");
                if (!widgets.get(231, 2).isHidden()) {
                    log("vin2");
                    keyboard.pressKey(KeyEvent.VK_SPACE);
                    sleep(random(1000, 2000));
                    log("vin3");
                    keyboard.pressKey(KeyEvent.VK_NUMPAD2);
                    sleep(random(50, 150));
                    log("vin4");
                    keyboard.pressKey(KeyEvent.VK_SPACE);
                    sleep(random(50, 150));
                    log("vin5");
                    keyboard.pressKey(KeyEvent.VK_SPACE);
                    sleep(random(50, 150));
                    log("vin6");
                    keyboard.pressKey(KeyEvent.VK_NUMPAD1);
                    sleep(random(50, 150));
                    log("vin7");
                    keyboard.pressKey(KeyEvent.VK_SPACE);
                    sleep(random(50, 150));
                    log("vin8");
                    Col = 0;
                    log("vin9");
                    sleep (random(200, 400));
                }        
            }

 

Thanks in advance!

 

are the widgets all the same ? you should be using conditional sleeps for the next widget anyways

  • Author

I tryed to find turorial or some samples of widgets as I don't really understand yet how the work.

 

I will try to look in to Dialogues API maybe I will find tutoril or somethink like that about them

  • Author
1 hour ago, InsomniakSam said:

getDialogues().clickContinue();

I need it to press space, 2, space, space, 1, space

  • Author
On 17/03/2017 at 0:17 AM, whipz said:

are the widgets all the same ? you should be using conditional sleeps for the next widget anyways

I am not sure how to use conditional sleeps yet (just few days learning). I found the way to make it work but it is still buggy as sometimes it forgets to press it or just presses it to early. Learning every day!

1 hour ago, gurbangaming said:

I need it to press space, 2, space, space, 1, space

getDialogues().clickContinue(); for space

getDialogues().selectOption((2)); for 2

getDialogues().selectOption((1)); for 1

and for conditionnal sleep you should put

new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return dialogues.isPendingContinuation());

}

  • Author
On 19/03/2017 at 1:05 AM, InsomniakSam said:

getDialogues().clickContinue(); for space

getDialogues().selectOption((2)); for 2

getDialogues().selectOption((1)); for 1

and for conditionnal sleep you should put

new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return dialogues.isPendingContinuation());

}

Thank you! that looks promising :)

  • Author

Everything working fine just conditional sleep is not working right. It just flies through without waiting. I even tryed to change "isPendingContinuation());" to "isPendingOption();"

50 minutes ago, gurbangaming said:

Everything working fine just conditional sleep is not working right. It just flies through without waiting. I even tryed to change "isPendingContinuation());" to "isPendingOption();"

new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return dialogues.isPendingContinuation());

}.sleep();

1 hour ago, gurbangaming said:

all good now. Got it working perfect!

For future reference, there is an API method:

getDialogues().completeDialogue(String... options);

That will complete the entire dialog, including clicking continue and selecting options based on the Strings you provide.

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.