Jump to content

Getting quest status / progress


Recommended Posts

Posted (edited)

For the life of me this code doesn't do what I think it does

idea64_Agl2bGjHtP.png.9ad2bc7b767bad5c34aee7755a450275.png

Believe it or not the code inside this if statement executes when the quest is STARTED

In other words NOT is quest started is evaluating to TRUE when the quest IS started ⁉️

 

Does anyone have any best practices or any resources on code snippets to getting quest state / progress?

I've been going in raw just from the API and pulling my hair out.

 

 

Edited by EsotericRS
Posted
15 hours ago, Juggles said:

A lot of the Quest API doesn't work and it would take a long time to fix it as there's so many quests. 
Much easier for Scripters just to use configs to code their own quests when needed. Quests aren't a very popular thing with bots 

Thanks for this -- I did go ahead and try to move and grab the config when Goblin Diplomacy is picked up.

I captured 62:3 the moment the quest was accepted... Is there anything else to it? 

Posted
2 minutes ago, EsotericRS said:

Thanks for this -- I did go ahead and try to move and grab the config when Goblin Diplomacy is picked up.

I captured 62:3 the moment the quest was accepted... Is there anything else to it? 

Nope that's it. 

public void startedQuest() {

if (configs().get(62)==3) {

return true;

}

return false;

}

im on mobile you get the idea

  • Heart 1
Posted
1 hour ago, Juggles said:

Nope that's it. 

public void startedQuest() {

if (configs().get(62)==3) {

return true;

}

return false;

}

im on mobile you get the idea

10/10 S2 ability. Goodluck returning a void method 😉

public boolean isQuestStarted(Quest quest) {
	return quest.getConfig() > 0;
}

public enum Quest {
	GOBLIN_DIPLOMACY(63);
	
	int questConfig;
	
	Quest(int questConfig) {
		this.questConfig = questConfig;
	}

	public int getConfig() {
		return questConfig;
	}
}

I'd do something like this. Store all your quests in an enum and just check the config is > 0 to check if it's started. Quests also have finished settings, so you can store those in this enum as well and add an isQuestFinished method etc. :) Hope this helps.

  • Like 1
Posted
1 hour ago, Juggles said:

Nope that's it. 

public void startedQuest() {

if (configs().get(62)==3) {

return true;

}

return false;

}

im on mobile you get the idea

I didn't know a void method could return a value 🤔

Set up constants and then just do like 

if (setting < 1)

or 

boolean hasStarted() {
	return api.getsetting(questSetting) > 0;
}

can be done a million ways other than the way that @Juggles posted.

  • Like 1
Posted
53 minutes ago, HeyImJamie said:

10/10 S2 ability. Goodluck returning a void method 😉


public boolean isQuestStarted(Quest quest) {
	return quest.getConfig() > 0;
}

public enum Quest {
	GOBLIN_DIPLOMACY(63);
	
	int questConfig;
	
	Quest(int questConfig) {
		this.questConfig = questConfig;
	}

	public int getConfig() {
		return questConfig;
	}
}

I'd do something like this. Store all your quests in an enum and just check the config is > 0 to check if it's started. Quests also have finished settings, so you can store those in this enum as well and add an isQuestFinished method etc. :) Hope this helps.

 

34 minutes ago, godspower33 said:

I didn't know a void method could return a value 🤔

Set up constants and then just do like 


if (setting < 1)

or 


boolean hasStarted() {
	return api.getsetting(questSetting) > 0;
}

can be done a million ways other than the way that @Juggles posted.

Rip me a new one fam. I meant Boolean LOL. 

Thats why you don't type in a harry

  • Heart 1
Posted
2 minutes ago, Juggles said:

 

Rip me a new one fam. I meant Boolean LOL. 

Thats why you don't type in a harry

LOL they are giving you a hard time, I understood exactly what you meant and it was what I was going for 🤣

 

Quote

Store all your quests in an enum and just check the config is > 0 to check if it's started.

This is great advice. Thank you.

 

Thanks everyone :)

 

👍

Posted
16 hours ago, Patrick said:

You can't just check for config > 0 for all of them, some quests use a certain bitrange. 

Based on this response, wouldn't it be more ideal to check whether the config is not = to 0 ( Quest not started ) & not equal to ... ( Quest finished ), so >

 

    private boolean Goblin() {
        return getConfigs().get(63) != 0 && getConfigs().get(63) != (INT = to completed);
    }

this would check if the quest is started and not finished.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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