Jump to content

What's the best way to communicate with Dialogues?


Russian_Savage

Recommended Posts

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
Link to comment
Share on other sites


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));

}

}

Link to comment
Share on other sites

		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
Link to comment
Share on other sites

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