Xero 2 Share Posted April 15, 2016 Hi all,I'm trying to create a working tutorial bot; however, conversation cuts short when talking to the same NPC twice. This is an issue when talking to the Quest npc as you need to speak with him fully on the second conversation; however, it is cut short when I go click the ladder. Here's my code for the tutorial npc (it cuts short but isnt an issue.): NPC guide = getNPCs("RuneScape Guide"); interactWithCharacter(guide, "Talk-to"); sleep(2500,5000); this.getWidgets().getChildWidget(548, 39).interact(); sleep(2500,5000); interactWithCharacter(guide, "Talk-to"); GameObject door = getGameObject("Door"); sleep(2500,5000); openDoor(door); sleep(2500,5000); if(this.getLocalPlayer().getTile().equals(new Tile(3098,3107,0))){ moveCharacter(treeArea); open = true; } private void interactWithCharacter(NPC npc, String interact){ npc.interact(interact); sleepUntil(() -> npc.isInteracting(getLocalPlayer()), 15000); while (this.getDialogues().canContinue() == true) { log("Is in Dialogue? " + this.getDialogues().canContinue()); this.getDialogues().clickContinue(); sleep(2500, 4000); } } private NPC getNPCs(String object) { return this.getNpcs().closest(npc -> npc != null && npc.getName().equals(object)); } Any suggestions? Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted April 15, 2016 I would suggest making your code less linear and more conditional. Example: if (finishedQuestDialogue) { goDownLadder(); } else { if (interacting with quest guy) { if (in dialogue) { do dialogue stuff; } } else { interact; } } This may not exactly answer your question, but it may help. It's a bit confusing trying to understand what your issue is, so if you could explain a bit more I can help further Link to comment Share on other sites More sharing options...
Pug 130 Share Posted April 15, 2016 you should also use configs if you arent already will make your life alot easier. nezz's tut island script is here:https://github.com/Nezzima/DreamBot/blob/master/DreambotTutIsland/src/nezz/dreambot/scriptmain/tutisland/TutorialIsland.java though might be out of data now idk if he updates it. Link to comment Share on other sites More sharing options...
Xero 2 Author Share Posted April 15, 2016 Thanks for the help and suggestions for my overall outlook on creating this script.As for my solution that seems to work, I added sleep(2500,4500); after the sleepUntil in my interactingWithCharacter and it started to work correctly (perhaps the dialogue occurs too quickly for the client to catch).I'll be looking up what you mean by configs and see as to how i can make my bot more conditional rather than linear. Link to comment Share on other sites More sharing options...
Pug 130 Share Posted April 15, 2016 Thanks for the help and suggestions for my overall outlook on creating this script. As for my solution that seems to work, I added sleep(2500,4500); after the sleepUntil in my interactingWithCharacter and it started to work correctly (perhaps the dialogue occurs too quickly for the client to catch). I'll be looking up what you mean by configs and see as to how i can make my bot more conditional rather than linear. configs are playerSettings().getConfig(123) the little progress bar you see along the bottom of the screen when on the island is a ascending number which is found in the configs, use the game debugger>player settings to see which number it is that changes. Link to comment Share on other sites More sharing options...
Xero 2 Author Share Posted April 15, 2016 configs are playerSettings().getConfig(123) the little progress bar you see along the bottom of the screen when on the island is a ascending number which is found in the configs, use the game debugger>player settings to see which number it is that changes. EDIT: Wow, sorry, I didn't read the whole sentence. Thanks! Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted April 16, 2016 How do you find the configuration numbers in the client? I don't see them in the Debug options. In the Game Debugger under Player Settings. Link to comment Share on other sites More sharing options...
Juggles 18 Share Posted April 16, 2016 Instead of using sleep, i prefer this code. It helps to prevent it from getting stuck sleepUntil(new Condition(){public boolean verify(){return (Enter what ever code you want here without parenthesis);}},Calculations.random(10000, 11000)); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.