Jump to content

LONG Dialogue Help!


imancity

Recommended Posts

So the final puzzle to my new script.

 

This dialogue begins with 11 "Click to Continues", followed by a option 3, followed by 7 more "Click to Continues". In the middle of the last 7 the player receives an object at which point I have it set that my player automatically uses it, cutting off the dialogue like it should. My problem is that I've only gotten him to get through it once.

 

First I had 19 different If/then statements in order, but that didn't work. I tried throwing in some while statements but no. He goes randomly 3 or 4 continues in and then just stops.

 

Here is my latest attempt, I've changed the names until I finish the script, its a surprise (if you guess it, shh!).

 

I'm not sure what to do.

if ((AREA.contains(myPosition())) && (!getDialogues().inDialogue())) {
            npcs.closest("THEDUDE").interact("Talk-to");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getDialogues().inDialogue();
                }
            }.sleep();

            if(dialogues.inDialogue()) {
                if (dialogues.isPendingContinuation() && (!getInventory().contains("THEITEM"))) {
                    if(dialogues.clickContinue()) {
                        sleep(random(100, 300));
                    }
                } else if (dialogues.isPendingOption()) {
                    if(dialogues.selectOption(3)) {
                        sleep(random(100, 300));
                    }
                }
            }

Any help is appreciated! Will be back on tomorrow to fix it.

Link to comment
Share on other sites

if ((AREA.contains(myPosition())) {

 if(dialogues.inDialogue()) {
                if (dialogues.isPendingContinuation() && (!getInventory().contains("THEITEM"))) {
                    if(dialogues.clickContinue()) {
                        sleep(random(100, 300));
                      
                    }
                } else if (dialogues.isPendingOption()) {
                    if(dialogues.selectOption(3)) {
                        sleep(random(100, 300));
                      
                    }
                }
}else{

            npcs.closest("THEDUDE").interact("Talk-to");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getDialogues().inDialogue();
                }
            }.sleep();
}
           

 perhaps?

Edited by Tom
Link to comment
Share on other sites

if ((AREA.contains(myPosition())) && (!getDialogues().inDialogue())) {

 if(dialogues.inDialogue()) {
                if (dialogues.isPendingContinuation() && (!getInventory().contains("THEITEM"))) {
                    if(dialogues.clickContinue()) {
                        sleep(random(100, 300));
                      
                    }
                } else if (dialogues.isPendingOption()) {
                    if(dialogues.selectOption(3)) {
                        sleep(random(100, 300));
                      
                    }
                }
}else{

            npcs.closest("THEDUDE").interact("Talk-to");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getDialogues().inDialogue();
                }
            }.sleep();
}
           

 perhaps?

 

 

Hmm I tried this and now he just clicks the NPC and doesn't go through the dialogue at all.

 

Does anyone else have any ideas? I'm stumped.

Link to comment
Share on other sites

It shouldn't click the NPC as long as its in a dialogue.

youre checking if its not in dialogue and its in dialogue at the same time though :E

try this:

			if (AREA.contains(myPosition())) {
				if (getDialogues().inDialogue()) {
					if (dialogues.isPendingContinuation() && !getInventory().contains("THEITEM")) {
						if (dialogues.clickContinue()) {
							sleep(400);
						}
					} else if (dialogues.isPendingOption()) {
						if (dialogues.selectOption(3)) {
							sleep(400);
						}
					}
				} else {
					npcs.closest("THEDUDE").interact("Talk-to");
					new ConditionalSleep(5000) {
						@Override
						public boolean condition() throws InterruptedException {
							return getDialogues().inDialogue();
						}
					}.sleep();
				}
			}
  • Like 1
Link to comment
Share on other sites

 

youre checking if its not in dialogue and its in dialogue at the same time though :E

try this:

			if (AREA.contains(myPosition())) {
				if (getDialogues().inDialogue()) {
					if (dialogues.isPendingContinuation() && !getInventory().contains("THEITEM")) {
						if (dialogues.clickContinue()) {
							sleep(400);
						}
					} else if (dialogues.isPendingOption()) {
						if (dialogues.selectOption(3)) {
							sleep(400);
						}
					}
				} else {
					npcs.closest("THEDUDE").interact("Talk-to");
					new ConditionalSleep(5000) {
						@Override
						public boolean condition() throws InterruptedException {
							return getDialogues().inDialogue();
						}
					}.sleep();
				}
			}

 

I didn't even see that top line, lel

Link to comment
Share on other sites

 

youre checking if its not in dialogue and its in dialogue at the same time though :E

try this:

			if (AREA.contains(myPosition())) {
				if (getDialogues().inDialogue()) {
					if (dialogues.isPendingContinuation() && !getInventory().contains("THEITEM")) {
						if (dialogues.clickContinue()) {
							sleep(400);
						}
					} else if (dialogues.isPendingOption()) {
						if (dialogues.selectOption(3)) {
							sleep(400);
						}
					}
				} else {
					npcs.closest("THEDUDE").interact("Talk-to");
					new ConditionalSleep(5000) {
						@Override
						public boolean condition() throws InterruptedException {
							return getDialogues().inDialogue();
						}
					}.sleep();
				}
			}

 

Yess!!! perfect! my man, thanks so much. Its going!

 

Hey, do you mind if I PM you a few questions and etc about my script. Its one I havent seen anywhere and if it runs good I wanna see what I should do with it. (never tried to release to SDN before)

 

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