Markoz Posted October 15, 2013 Share Posted October 15, 2013 (edited) I was going to use this on a script but i decided to stop the development, so before scrapping it i decided to release it: This holds the answers: String[] strongholdTexts = { "To help me recover my password if I forget it or it is stolen", "Use the 'Recover a Lost Password' section on the RuneScape website", "Don't give them the information and send an", "Nowhere", "Recovering your account if it is stolen.", "Every couple of months", "Don't tell them anything and click the", "Virus scan my computer then change my password and recoveries", "does not block your password", "Only on the RuneScape website", "Game Inbox on the RuneScape website", "No", "No, it might steal my password", "Don't give him my password", "Nobody", "Don't tell them anything and inform", "Memorable", "The birthday of a famous person or event", "Politely tell them no and then use the" }; This clicks the first interface: if (client.getInterface(242) != null) { if (client.getInterface(242).getChild(2).getMessage() .contains("To pass you must answer me this:")) { if (client.getInterface(242).getChild(4) != null) { selectInterfaceOption(242, 4, "Continue"); sleep(1000); } } } This answers the second one: if (client.getInterface(230) != null) { if (client.getInterface(230).getChild(6) != null) { int childLength = client.getInterface(230).getChildren().length; for (int i = 0; i < childLength; i++) { for (int a = 0; a < strongholdTexts.length; a++) { if (client.getInterface(230).getChild(i).getMessage() .contains(strongholdTexts[a])) { selectInterfaceOption(230, i, "Continue"); sleep(1000); } } } } } And this clicks the last interface(which vary interface child and parent numbers, idk why): if (client.getInterface(243) != null) { if (client.getInterface(243).getChild(2) != null) { if (client.getInterface(243).getChild(2).getMessage() .contains("Correct!")) { int childLength = client.getInterface(243).getChildren().length; selectInterfaceOption(243, childLength - 1, "Continue"); sleep(1000); } } } if (client.getInterface(244) != null) { if (client.getInterface(244).getChild(2) != null) { if (client.getInterface(244).getChild(2).getMessage() .contains("Correct!")) { int childLength = client.getInterface(244).getChildren().length; selectInterfaceOption(244, childLength - 1, "Continue"); sleep(1000); } } } if (client.getInterface(242) != null) { if (client.getInterface(242).getChild(2) != null) { if (client.getInterface(242).getChild(2).getMessage() .contains("Correct!")) { int childLength = client.getInterface(242).getChildren().length; selectInterfaceOption(242, childLength - 1, "Continue"); sleep(1000); } } } if (client.getInterface(241) != null) { if (client.getInterface(241).getChild(2) != null) { if (client.getInterface(241).getChild(2).getMessage() .contains("Correct!")) { int childLength = client.getInterface(241).getChildren().length; selectInterfaceOption(241, childLength - 1, "Continue"); sleep(1000); } } } It may not be the best way to do this, but it was a working quick fix for me =p, feel free to grab the code or even clean it a little bit for us. And if someone with bigger knowledge could point out some bad pratices, etc. I would be grateful ps: i know its simple.. but could save someones time Edited October 15, 2013 by Markoz Link to comment Share on other sites More sharing options...
Mr Asshole Posted October 16, 2013 Share Posted October 16, 2013 You could compress it into one method instead of writing it like 5 times. Lol. Just call method with parameters for parent Interface and child interface. Link to comment Share on other sites More sharing options...
Swizzbeat Posted October 16, 2013 Share Posted October 16, 2013 Instead of checking for the initial interface you could use the inDialogue() method! There's also a continueDialogue() instead of writing out a line to press continue :P Other then that looks good, but as Pain said you could easily cut this down. Link to comment Share on other sites More sharing options...
triggamortis Posted October 17, 2013 Share Posted October 17, 2013 (edited) nvm Edited October 17, 2013 by triggamortis Link to comment Share on other sites More sharing options...
CyanSales Posted October 17, 2013 Share Posted October 17, 2013 Lol, Stronghold sooooo last year haha xD Link to comment Share on other sites More sharing options...
TheScrub Posted October 21, 2013 Share Posted October 21, 2013 there is a problem with this snippet not all the questions are on the interface 230 so you will need to run a for each loop though all the interfaces not just the children and text Link to comment Share on other sites More sharing options...