Jump to content

LONG Dialogue Help!


Recommended Posts

Posted

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.

Posted (edited)
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
Posted
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.

Posted

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
Posted

 

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

Posted

 

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)

 

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