imancity Posted May 13, 2016 Share Posted May 13, 2016 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. Quote Link to comment Share on other sites More sharing options...
Tom Posted May 13, 2016 Share Posted May 13, 2016 (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 May 13, 2016 by Tom Quote Link to comment Share on other sites More sharing options...
imancity Posted May 13, 2016 Author Share Posted May 13, 2016 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. Quote Link to comment Share on other sites More sharing options...
Tom Posted May 13, 2016 Share Posted May 13, 2016 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. It shouldn't click the NPC as long as its in a dialogue. Quote Link to comment Share on other sites More sharing options...
Acerd Posted May 13, 2016 Share Posted May 13, 2016 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(); } } 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted May 13, 2016 Share Posted May 13, 2016 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 Quote Link to comment Share on other sites More sharing options...
imancity Posted May 13, 2016 Author Share Posted May 13, 2016 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) Quote Link to comment Share on other sites More sharing options...
Acerd Posted May 13, 2016 Share Posted May 13, 2016 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) sure 1 Quote Link to comment Share on other sites More sharing options...