Jump to content

Dialogues sometimes break?


Johnxtrem

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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... :/

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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