Jump to content

Getting quest status / progress


EsotericRS

Recommended Posts

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
Link to comment
Share on other sites

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? 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 :)

 

👍

Link to comment
Share on other sites

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.

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...