Jump to content

What's the best way to communicate with Dialogues?


Recommended Posts

Posted (edited)
if(dialogues.isPendingContinuation() || dialogues.clickContinue()
|| dialogues.completeDialogue("option1", "option2", "option3"))
return random(300,600);

 

 

I am sorry for being a complete noob, but how would I use that.

 

I tried entering it like this.

if(npc != null)
   if(npc.isOnScreen()){
      npc.interact("Talk-to");
	if(dialogues.isPendingContinuation() || dialogues.clickContinue()
	|| dialogues.completeDialogue("option 1"))
		 return random(300,600);
}else{
if (!npc.isOnScreen());
localWalker.walk(npc); 
}

But it's not working.

Edited by Russian_Savage
Posted


if (!dialogues.inDialogue()) {

if (npc != null) {

if (npc.isVisible()) {

if (npc.interact("Talk-to")) {

new ConditionalSleep(random(1000, 2000)) {

public boolean condition() throws InterruptedException {

return dialogues.inDialogue();

}

}.sleep();

}

} else {

getCamera().toEntity(npc);

}

}

} else {

if (dialogues.isPendingOption()) {

dialogues.completeDialogue("plebs4free", "plebs4free", "plebs4free","plebs4free");

sleep(random(400, 900));

}

if (dialogues.isPendingContinuation()) {

dialogues.clickContinue();

sleep(random(400, 900));

}

}

Posted (edited)
		if (!dialogues.inDialogue()) {
			if (npc != null) {
				if (npc.isVisible()) {
					if (npc.interact("Talk-to")) {
				          new ConditionalSleep(random(1000, 2000)) {
				              public boolean condition() throws InterruptedException {
				                return dialogues.inDialogue();
				              }
				            }.sleep();
					}
				} else {
					getCamera().toEntity(npc);
				}
			}
		} else {
			if (dialogues.isPendingOption()) {
				dialogues.completeDialogue("plebs4free", "plebs4free", "plebs4free","plebs4free");
				sleep(random(400, 900));
			}
			if (dialogues.isPendingContinuation()) {
				dialogues.clickContinue();
				sleep(random(400, 900));
			}
		}

Thank you for the help really appreciate it. I hate being spoon fed so could you tell me why my code didn't work. Was it because i didnt check if i was in dialogue in the beginning?  minus the shit code of course. XD

Edited by Russian_Savage
Posted

Another handy thing to do is you can now simply press SPACE on your keyboard to continue, and the numbers 1 through x for the options.

Press space:

getKeyboard().typeKey((char)32);

Character code 32 equates to SPACE (" ")

 

A list of character codes: (Look at the DEC values)

asciifull.gif

 

If you want to press enter, you need to press 2 keys in rapid succession, which are keys 13 and 10:

getKeyboard().typeKey((char)13);
getKeyboard().typeKey((char)10);
  • Like 1

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