Jump to content

[Quest] Rune Mysteries


bumzag

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...