Jump to content
Eagle Scripts

Problem with dialogue series

Recommended Posts

Hello fellas it's me again,

I'm trying to get my script past a series of dialogues, where there is a continue option or 2 options to choose the script manages to click my chosen option. When the script is at the dialogue which contains 3 options, it somehow fails to choose the option i want it to choose.

Does anybody know why this is / how to fix this?

My code :

	case WALK_BANK_D1:
			if(dialogues.isPendingContinuation()) {
				dialogues.clickContinue();
				sleep(random(200, 600));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Can I journey on this ship?");
				sleep(random(200, 600));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Search away, I have nothing to hide.");
				sleep(random(200, 600));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Ok.");
				sleep(random(200, 600));

This is where the problem occurs :
 

} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Search away, I have nothing to hide.");
				sleep(random(200, 600));
Link to comment
Share on other sites

I feel you don't fully understand else statements.

  String[] options = new String[]{"Can I journey on this ship?",
                                  "Search away, I have nothing to hide.",
                                  "Ok." };
                    if(dialogues.isPendingContinuation()){
                        dialogues.clickContinue();
                    }else if (dialogues.isPendingOption()){
                        if(dialogues.selectOption(options)){
                            sleep(random(200, 600));
                        }
                    }
Edited by Isolate
Link to comment
Share on other sites

 

I feel you don't fully understand else statements.

  String[] options = new String[]{"Can I journey on this ship?",
                                  "Search away, I have nothing to hide.",
                                  "Ok." };
                    if(dialogues.isPendingContinuation()){
                        dialogues.clickContinue();
                    }else if (dialogues.isPendingOption()){
                        if(dialogues.selectOption(options)){
                            sleep(random(200, 600));
                        }
                    }

 

Yes, you are right i'm still looking into all of it.

Could you rewrite this code for me with the method you just did?

http://pastebin.com/SEMnP0FX

 

Link to comment
Share on other sites

Yes, you are right i'm still looking into all of it.

Could you rewrite this code for me with the method you just did?

http://pastebin.com/SEMnP0FX

 

  private final String[] SEAMAN_OPTIONS = new String[]{"Can I journey on this ship?",
                                                       "Search away, I have nothing to hide."
      };

    void handleSeaman() throws InterruptedException {
        if(dialogues.inDialogue()){
             if(dialogues.isPendingContinuation()){
                 if(dialogues.clickContinue()){
                     sleep(random(200, 600));
                 }
             }else if(dialogues.isPendingOption()){
                 if(dialogues.selectOption(SEAMAN_OPTIONS)){
                     sleep(random(200, 600));
                 }
             }
        }else{
            NPC seaman = npcs.closest(new Filter<NPC>() {
                @Override
                public boolean match(NPC npc) {
                    return npc != null && npc.getName().contains("Seaman");
                }
            });
            if(seaman != null){
                if(seaman.isVisible()){
                    if(seaman.interact("Pay-fare")){
                        sleep(random(750, 900));
                    }
                }else{
                    camera.toEntity(seaman);
                }
            }
        }
    }
}

Even though i'm pretty sure that's the dialog for the customs officer...

Link to comment
Share on other sites

  private final String[] SEAMAN_OPTIONS = new String[]{"Can I journey on this ship?",
                                                       "Search away, I have nothing to hide."
      };

    void handleSeaman() throws InterruptedException {
        if(dialogues.inDialogue()){
             if(dialogues.isPendingContinuation()){
                 if(dialogues.clickContinue()){
                     sleep(random(200, 600));
                 }
             }else if(dialogues.isPendingOption()){
                 if(dialogues.selectOption(SEAMAN_OPTIONS)){
                     sleep(random(200, 600));
                 }
             }
        }else{
            NPC seaman = npcs.closest(new Filter<NPC>() {
                @Override
                public boolean match(NPC npc) {
                    return npc != null && npc.getName().contains("Seaman");
                }
            });
            if(seaman != null){
                if(seaman.isVisible()){
                    if(seaman.interact("Pay-fare")){
                        sleep(random(750, 900));
                    }
                }else{
                    camera.toEntity(seaman);
                }
            }
        }
    }
}

Even though i'm pretty sure that's the dialog for the customs officer...

 

 

Using that doesn't work for me.

But the other series of dialogues runs fine for me, same method :

 

case WALK_BACK_D1:
			if(dialogues.isPendingContinuation()) {
				dialogues.clickContinue();
				sleep(random(200, 700));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Yes please.");
				sleep(random(200, 700));
			} else {
				Entity sailor = npcs.closest("Seaman Thresnor", "Seaman Lorris", "Captain Tobias");
				if (sailor!= null) {
					sailor.interact("Pay-fare");
				} else {
					log("Sailor is null");
				}
			}
			sleep(random(200, 600));
			break;
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.

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