EsotericRS Posted May 10, 2019 Share Posted May 10, 2019 (edited) For the life of me this code doesn't do what I think it does 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 May 10, 2019 by EsotericRS Quote Link to comment Share on other sites More sharing options...
Chris Posted May 10, 2019 Share Posted May 10, 2019 Quest api prob broken Quote Link to comment Share on other sites More sharing options...
Juggles Posted May 10, 2019 Share Posted May 10, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
EsotericRS Posted May 10, 2019 Author Share Posted May 10, 2019 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? Quote Link to comment Share on other sites More sharing options...
Juggles Posted May 10, 2019 Share Posted May 10, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted May 10, 2019 Share Posted May 10, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
godspower33 Posted May 10, 2019 Share Posted May 10, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
Juggles Posted May 10, 2019 Share Posted May 10, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
Developer Patrick Posted May 10, 2019 Developer Share Posted May 10, 2019 4 minutes ago, Juggles said: Rip me a new one fam. I meant Boolean LOL. Thats why you don't type in a harry harry 1 1 Quote Link to comment Share on other sites More sharing options...
EsotericRS Posted May 10, 2019 Author Share Posted May 10, 2019 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 Quote Link to comment Share on other sites More sharing options...
Developer Patrick Posted May 11, 2019 Developer Share Posted May 11, 2019 You can't just check for config > 0 for all of them, some quests use a certain bitrange. 1 Quote Link to comment Share on other sites More sharing options...
Spiderman Posted May 11, 2019 Share Posted May 11, 2019 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. Quote Link to comment Share on other sites More sharing options...