Hannes7337 Posted March 4, 2018 Share Posted March 4, 2018 I'm currently working on a Varrock Museum script for the 1k hunter and slayer xp However, I have a few problems regarding my code architecture. My idea is to solve the questions based on configs. For example, when config 1014 equals 2 the script should solve the Lizard questions. I think a switch statement is the best option to decide which animal to solve. I'm using an abstract Quiz class where most of my functions are defined, like walking to the right display position. I want to create subclasses for every animal that holds the questions, answers and the display position. So far my subclasses looks redundant, because I'm only using a constructor to pass the questions, answers and display position. Is it better to use, for example, a Enum that holds all the data? Can someone help me out here? Quote Link to comment Share on other sites More sharing options...
Apaec Posted March 4, 2018 Share Posted March 4, 2018 It's an interesting question, naturally there's no correct answer. I can't remeber exactly how the museum works, but I think it would be sufficient to store all the data in one big DisplayCase enum (position, config val, questions etc). Perhaps also create classes encapsulating questions and answers, and other intricacies. I'd do it this way because 1: all display cases are the same, thus there's really no need for inheritance, and 2: All the data is in one place so it's easier to manipulate when needed. You can then, as you suggested, switch through the current config value to determine the corresponding display case, and act on the data respectively. Good luck! Apa 2 Quote Link to comment Share on other sites More sharing options...
Butters Posted March 4, 2018 Share Posted March 4, 2018 7 minutes ago, Apaec said: It's an interesting question, naturally there's no correct answer. I can't remeber exactly how the museum works, but I think it would be sufficient to store all the data in one big DisplayCase enum (position, config val, questions etc). Perhaps also create classes encapsulating questions and answers, and other intricacies. I'd do it this way because 1: all display cases are the same, thus there's really no need for inheritance, and 2: All the data is in one place so it's easier to manipulate when needed. You can then, as you suggested, switch through the current config value to determine the corresponding display case, and act on the data respectively. Good luck! Apa Was thinking on the exact same lines. Put each display case data into an enum value (config, position, answers) and etc) and just grab the appropriate "enum record" in your onLoop based on the config value present. As Apa mentioned, no real need for inheritance here. Can also just use if/switch statements and you'll end up with one class. Quote Link to comment Share on other sites More sharing options...
Hannes7337 Posted March 4, 2018 Author Share Posted March 4, 2018 Thanks for the advise! I'll try to implement a Enum since that sounds more logical then. Quote Link to comment Share on other sites More sharing options...
liverare Posted March 4, 2018 Share Posted March 4, 2018 (edited) Enum for the data. Custom API for everything relating to the Museum (and only the museum - which will also include the enum). Task/Node or plain code for macro logic. Edited March 4, 2018 by liverare Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted March 4, 2018 Share Posted March 4, 2018 3 hours ago, liverare said: Enum for the data. Custom API for everything relating to the Museum (and only the museum - which will also include the enum). Task/Node or plain code for macro logic. This is what I did for mine in my AIO Hunter script. Also if you are wanting a free script that has been made already, there is one on the SDN. Good luck though Quote Link to comment Share on other sites More sharing options...
Hannes7337 Posted March 4, 2018 Author Share Posted March 4, 2018 (edited) 2 hours ago, ProjectPact said: This is what I did for mine in my AIO Hunter script. Also if you are wanting a free script that has been made already, there is one on the SDN. Good luck though Thank you! I'll take a look on the SDN then Edited March 4, 2018 by Hannes7337 I tried the museum script on the SDN recently. It's not working at the moment that's why I'm making one Quote Link to comment Share on other sites More sharing options...
killercrak Posted March 4, 2018 Share Posted March 4, 2018 2 hours ago, ProjectPact said: This is what I did for mine in my AIO Hunter script. Also if you are wanting a free script that has been made already, there is one on the SDN. Good luck though That script does not work. Quote Link to comment Share on other sites More sharing options...
H0rn Posted March 7, 2018 Share Posted March 7, 2018 On 3/4/2018 at 11:18 PM, killercrak said: That script does not work. Definitely does, I've used it many times lol Quote Link to comment Share on other sites More sharing options...
Hannes7337 Posted March 7, 2018 Author Share Posted March 7, 2018 3 hours ago, H0rn said: Definitely does, I've used it many times lol Have you used it recently? I tried the script like 1 month ago and it got stuck talking to Orlando Quote Link to comment Share on other sites More sharing options...
H0rn Posted March 7, 2018 Share Posted March 7, 2018 3 hours ago, Hannes7337 said: Have you used it recently? I tried the script like 1 month ago and it got stuck talking to Orlando Hmm, not too recently but I did use it when I created my pure about 2 weeks ago, maybe try again Quote Link to comment Share on other sites More sharing options...
killercrak Posted March 7, 2018 Share Posted March 7, 2018 7 hours ago, H0rn said: Definitely does, I've used it many times lol I just tried to use it on a new pure a few days ago. It did not even load at all. Quote Link to comment Share on other sites More sharing options...
Hannes7337 Posted March 8, 2018 Author Share Posted March 8, 2018 23 hours ago, killercrak said: I just tried to use it on a new pure a few days ago. It did not even load at all. Anyways, I'm finishing up my Museum script code and after that I need to test it on a few accounts. Too bad I need to use bonds to make them member ; p When it's done I'll release it as a free script Quote Link to comment Share on other sites More sharing options...