Articron 738 Share Posted February 17, 2018 So @@JagexPlease PMed me the following: So I decided to write him up a quick script skeleton, as I would love to see new quest scripts being developed Quest scripts in particular have a soft spot for me personally so yeah, there you go. His main concern: His main concern was about how he can use OOP to inherit off a quest superclass, but have different handler classes for each. Maybe this is a useful resource for the people who want to get into generics and aren't sure on how to use them? You can find the skeleton here: https://github.com/articron/Quest-skeleton/tree/master/src/org/dreambot/articron I commented my code left and right, so if there's something unclear let me know Also: Feel free to give constructive criticism if it's due, improvement is what we all want in the end! Link to comment Share on other sites More sharing options...
Dinh 496 Share Posted February 17, 2018 can just leech of my code 2 if u want skeleton eDIt; u shoudl check shep by id not name cuz 1 sheep is secret penguin11 Link to comment Share on other sites More sharing options...
Articron 738 Author Share Posted February 17, 2018 can just leech of my code 2 if u want skeleton CmonBruh Link to comment Share on other sites More sharing options...
dQw4w9WgXcQ 184 Share Posted February 18, 2018 zscorpio is that u Link to comment Share on other sites More sharing options...
Articron 738 Author Share Posted February 18, 2018 zscorpio is that u I wonder why he hasn't posted on this thread yet :thinking: Link to comment Share on other sites More sharing options...
7804364 230 Share Posted February 18, 2018 I used this on my main and got max stats + 2b, ty ty for release. Link to comment Share on other sites More sharing options...
dream123 3 Share Posted March 5, 2018 this is insane, your skills give me depression Link to comment Share on other sites More sharing options...
Nuclear Nezz 2051 Share Posted March 5, 2018 For your isStarted and isFinished, rather than just doing getPlayerSettings().getConfig(id) == 100 you should change the getPlayerSetting method in SheepShearer to & the config by a value. So once you get the finish value of sheep shearer, say on finish it's 8 (no idea what it actually is) well 8 is 1010 in binary, you know 100% now that those 4 bits are used only for this quest So you should instead clean the config by those 4 bits, so you'd and it by 1111, or 15. So the getPlayerSetting() method would now do return (getPlayerSettings().getConfig(id)&cleanValue); Then your isStarted would do say: return getPlayerSetting() != 0;since you know at every step of the quest, at least one of those bits is going to be a 1, which means the value won't ever return 0 if it's started. Then your isFinished would do: return getPlayerSetting() == finishedValue; So ideally your quest framework would also contain variables for cleanValue and finishedValue This is all in reference to the sheep shearer implementation: https://github.com/articron/Quest-skeleton/blob/master/src/org/dreambot/articron/quest/impl/sheepshearer/SheepShearer.java Link to comment Share on other sites More sharing options...
Articron 738 Author Share Posted March 6, 2018 For your isStarted and isFinished, rather than just doing getPlayerSettings().getConfig(id) == 100 you should change the getPlayerSetting method in SheepShearer to & the config by a value. So once you get the finish value of sheep shearer, say on finish it's 8 (no idea what it actually is) well 8 is 1010 in binary, you know 100% now that those 4 bits are used only for this quest So you should instead clean the config by those 4 bits, so you'd and it by 1111, or 15. So the getPlayerSetting() method would now do return (getPlayerSettings().getConfig(id)&cleanValue); Then your isStarted would do say: return getPlayerSetting() != 0; since you know at every step of the quest, at least one of those bits is going to be a 1, which means the value won't ever return 0 if it's started. Then your isFinished would do: return getPlayerSetting() == finishedValue; So ideally your quest framework would also contain variables for cleanValue and finishedValue This is all in reference to the sheep shearer implementation: https://github.com/articron/Quest-skeleton/blob/master/src/org/dreambot/articron/quest/impl/sheepshearer/SheepShearer.java Seperately defining a bitmask does sound like a good idea, as well as your other ideas. Cheers! I'll put those changes in when I'm off work I generally don't know much about quest scripting (or their config behaviour) to begin with, I was trying to emphasise object orientation and generics Link to comment Share on other sites More sharing options...
Scorpius 144 Share Posted March 6, 2018 idk my framework has like 10 less .java files 'n its still modular Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.