Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Questing framework


    Articron

    Recommended Posts

    So @@JagexPlease PMed me the following:

     

    unknown.png

     

    So I decided to write him up a quick script skeleton, as I would love to see new quest scripts being developed :P

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

     

    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

    • 2 weeks later...

    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

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

     

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

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.