March 17, 20178 yr Hi! I am new to this forum and new to scripting. I am in scripting progress and I came with an issue where I am stuck. Usually I just google for answers but now even google can't help me. I am trying to make my bot to talk with NPC but it just gets stuck after it presses space when it just starts talking. And it looks like that script is going through all lines as it returns all log here is my part of script I am having issues with. if (widgets.get(231, 2) != null) { log("vin1"); if (!widgets.get(231, 2).isHidden()) { log("vin2"); keyboard.pressKey(KeyEvent.VK_SPACE); sleep(random(1000, 2000)); log("vin3"); keyboard.pressKey(KeyEvent.VK_NUMPAD2); sleep(random(50, 150)); log("vin4"); keyboard.pressKey(KeyEvent.VK_SPACE); sleep(random(50, 150)); log("vin5"); keyboard.pressKey(KeyEvent.VK_SPACE); sleep(random(50, 150)); log("vin6"); keyboard.pressKey(KeyEvent.VK_NUMPAD1); sleep(random(50, 150)); log("vin7"); keyboard.pressKey(KeyEvent.VK_SPACE); sleep(random(50, 150)); log("vin8"); Col = 0; log("vin9"); sleep (random(200, 400)); } } Thanks in advance!
March 17, 20178 yr are the widgets all the same ? you should be using conditional sleeps for the next widget anyways
March 18, 20178 yr Author I tryed to find turorial or some samples of widgets as I don't really understand yet how the work. I will try to look in to Dialogues API maybe I will find tutoril or somethink like that about them
March 18, 20178 yr Author 1 hour ago, InsomniakSam said: getDialogues().clickContinue(); I need it to press space, 2, space, space, 1, space
March 19, 20178 yr Author On 17/03/2017 at 0:17 AM, whipz said: are the widgets all the same ? you should be using conditional sleeps for the next widget anyways I am not sure how to use conditional sleeps yet (just few days learning). I found the way to make it work but it is still buggy as sometimes it forgets to press it or just presses it to early. Learning every day!
March 19, 20178 yr 1 hour ago, gurbangaming said: I need it to press space, 2, space, space, 1, space getDialogues().clickContinue(); for space getDialogues().selectOption((2)); for 2 getDialogues().selectOption((1)); for 1 and for conditionnal sleep you should put new ConditionalSleep(5000) { @Override public boolean condition() { return dialogues.isPendingContinuation()); }
March 23, 20178 yr Author On 19/03/2017 at 1:05 AM, InsomniakSam said: getDialogues().clickContinue(); for space getDialogues().selectOption((2)); for 2 getDialogues().selectOption((1)); for 1 and for conditionnal sleep you should put new ConditionalSleep(5000) { @Override public boolean condition() { return dialogues.isPendingContinuation()); } Thank you! that looks promising
March 23, 20178 yr Author Everything working fine just conditional sleep is not working right. It just flies through without waiting. I even tryed to change "isPendingContinuation());" to "isPendingOption();"
March 23, 20178 yr 50 minutes ago, gurbangaming said: Everything working fine just conditional sleep is not working right. It just flies through without waiting. I even tryed to change "isPendingContinuation());" to "isPendingOption();" new ConditionalSleep(5000) { @Override public boolean condition() { return dialogues.isPendingContinuation()); }.sleep();
March 23, 20178 yr 1 hour ago, gurbangaming said: all good now. Got it working perfect! For future reference, there is an API method: getDialogues().completeDialogue(String... options); That will complete the entire dialog, including clicking continue and selecting options based on the Strings you provide.