Jump to content

Dialogues sometimes break?


Recommended Posts

Posted (edited)

Hey, I'm having issue with dialogs. dialogues.clickContinue(); sometimes just doesn't want to continue the conversation. Its like it doesn't find the widget or something.

Here's my code to finish a dialogue.

private void FinishDialogue() throws InterruptedException
{
    while (true)
    {
        boolean isPending = new ConditionalSleep(6*1000)
        {
            @Override
            public boolean condition() throws InterruptedException
            {
                return dialogues.isPendingContinuation();
            }
        }.sleep();

        if (isPending)
        {
            dialogues.clickContinue();
            sleep(650, 1050);

            continue;
        }

        break;
    }
}

 

Any directions to help solve this would be appreciated, thanks!

Edited by Johnxtrem
Posted (edited)
2 minutes ago, k9thebeast said:

You on tutorial island? Tutorial island is a bit different since I believe you are always in dialogue

I am indeed :D Interesting, I'll check a couple of things then. But what could be the reason just dialogues.clickContinue() doesn't work? Thanks!

Edited by Johnxtrem
Posted
2 minutes ago, k9thebeast said:

Not 100% sure, havent really editted my tut script in a while. Try sending a space. getKeyboard().typeString(" ");

I just checked and isPendingContinuation and inDialogue always returns true, so its kinda "annoying" to detect every part when exactly it is done. I've already tried the keyboard method, works but, yeah... :/

Posted (edited)

Solved it like this:

 

private void FinishDialogue() throws InterruptedException
{
    while (IsPendingContinue())
    {
        ClickContinue();
        sleep(650, 1050);
    }
}

private boolean ClickContinue()
{
    if (!IsPendingContinue())
        return false;

    keyboard.pressKey(32);
    return true;
}

private boolean IsPendingContinue()
{
    List<RS2Widget> widgetsList = widgets.getAll().stream().filter
            (w -> w.getMessage().equals("Click here to continue")).collect(Collectors.toList());

    return widgetsList.size() > 0;
}
Edited by Johnxtrem
  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...