bumzag Posted September 1, 2020 Share Posted September 1, 2020 Been working on an all-in-one trade restriction lifter, which includes getting 10qp. It's just easier to do Romeo & Juliet and Goblin Diplomacy. I doubt anyone will need it but here's a simple script to finish Rune Mysteries public Area dukeHoracioArea = new Area(3208, 3224, 3213, 3218).setPlane(1); public Area wizardTower = new Area(3102, 3164, 3104, 3163); public Area wizardTowerBasement = new Area(3101, 9574, 3107, 9567).setPlane(0); public Area varrockShop = new Area(3251, 3401, 3254, 3400); private void runeMysteries() throws InterruptedException { NPC dukeHoracio = getNpcs().closest("Duke Horacio"); NPC sedridor = getNpcs().closest("Sedridor"); NPC aubury = getNpcs().closest("Aubury"); if (configs.get(63) == 0) { walk(dukeHoracioArea); dukeHoracio.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && dialogues.completeDialogueU("Have you any quests for me?", "Sure, no problem."), 5000); } if (configs.get(63) == 1 || configs.get(63) == 2) { walk(wizardTowerBasement); sedridor.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && dialogues.completeDialogueU("I'm looking for the head wizard.", "Ok, here you are.", "Yes, certainly."), 5000); } if (configs.get(63) == 3) { walk(varrockShop); aubury.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && dialogues.completeDialogueU("I have been sent here with a package for you."), 5000); } if (configs.get(63) == 4) { aubury.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && !getDialogues().inDialogue(), 5000); } if (configs.get(63) == 5) { walk(wizardTowerBasement); sedridor.interact(); Sleep.sleepUntil(() -> dialogues.clickContinue() && !getDialogues().inDialogue(), 20000); } } public void walk(Area x) throws InterruptedException { if (!x.contains(myPosition())) getWalking().webWalk(x); } I'm sure there's plenty to be improved upon but I figured maybe it'll help someone. Quote Link to comment Share on other sites More sharing options...
Czar Posted September 1, 2020 Share Posted September 1, 2020 Already have this but good job, should be useful for other scripters, especially the configs. I recommend adding a few checks to prevent needless calls, and prevent nullpointers, e.g. checking if the npcs exist, check if store is open, check if dialogues are 'isPendingOption', and so on. Quote Link to comment Share on other sites More sharing options...
bumzag Posted September 1, 2020 Author Share Posted September 1, 2020 2 minutes ago, Czar said: Already have this but good job, should be useful for other scripters, especially the configs. I recommend adding a few checks to prevent needless calls, and prevent nullpointers, e.g. checking if the npcs exist, check if store is open, check if dialogues are 'isPendingOption', and so on. Will do, if not for this little script then for the other stuff I'm working. I definitely catch nullpointers in the log all the time, something I need to improve on. I just got more acquainted with the dialogue side of the API so I'll make sure to brush up on more. Thanks man 1 Quote Link to comment Share on other sites More sharing options...
Herpalerps Posted September 1, 2020 Share Posted September 1, 2020 Awesome idea and thanks for sharing to the community! Quote Link to comment Share on other sites More sharing options...