Jump to content

Dialogues


Kramnik

Recommended Posts

Hi,

been trying for sometime to make dialogue work in tutorial island, currently trying to make it work like below. I decompiled some questing script and found that it handles dialogues like this. But somehow it doesnt select "I am an experienced player". First time writing something to handle dialogues so hope you can help :) 

 

Entity cook = npcs.closest("Gielinor guide");
sleep(1000);
cook.interact();
sleep(1000);
if (cook != null) {
    if (!getDialogues().inDialogue()) {
        log("Not talking to guide. Starting conversation.");
        cook.interact(); //this is not working somehow, so added interaction event in beginning
        log("Sleeping until conversation starts!");
        new ConditionalSleep(5000,1000) {
            @Override
            public boolean condition() throws InterruptedException {
                return getDialogues().inDialogue();
            }
        }.sleep();
    }
    String[] options = new String[]{"Click here to continue",
            "I am an experienced player."};
    if (getDialogues().completeDialogue(options)) {
        log("Dialogue complete successfully!");
    } else {
        log("Dialogue failed!");
    }
    log("Just spoke with the guide!");
}
break;

 

Link to comment
Share on other sites

@KramnikYou can't use that much of the dialogue API on tutorial island because if you use getDialogue.inDialogue() the bot will think you're always in dialogue when you're not. You gotta make you're own dialogue detection and handler. I think it's because the dialogue detection looks for blue text or something. I don't remember why it breaks on tut but it does.

If you want you can look at how Explv handled dialogue

https://osbot.org/forum/topic/84213-explvs-tutorial-island-free-random-characters/

  • Like 1
Link to comment
Share on other sites

12 minutes ago, Gunman said:

@KramnikYou can't use that much of the dialogue API on tutorial island because if you use getDialogue.inDialogue() the bot will think you're always in dialogue when you're not. You gotta make you're own dialogue detection and handler. I think it's because the dialogue detection looks for blue text or something. I don't remember why it breaks on tut but it does.

If you want you can look at how Explv handled dialogue

https://osbot.org/forum/topic/84213-explvs-tutorial-island-free-random-characters/

Hmm, I thought that this is probably because you always see something in chatbox. Explvs stuff is very complicated to read because of different files and etc, but will give it a second look, thanks :D 

Link to comment
Share on other sites

21 minutes ago, Kramnik said:

Hmm, I thought that this is probably because you always see something in chatbox. Explvs stuff is very complicated to read because of different files and etc, but will give it a second look, thanks :D 

https://github.com/Explv/Tutorial-Island/blob/master/src/sections/TutorialSection.java#L55 It's how he did it.

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