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
  • Best way to tackle a "multi" script?


    Bryno

    Recommended Posts

    Hello fellow dreambot programmer! :D 

    I am thinking of making a script inwhich it will do multiple different tasks...

    However, I can see this getting very deep and complex relatively quick.

    So I am asking for all tips/suggestions for trying to tackle this task with the most optimal and conventional ways of programming.

     

    My Idea was to have basically the Main class be:

    on Loop() {
        currentTask.loop();
    }

    and then having an ArrayList<Tasks> and selecting a "currentTask"  (which can be shuffled randomly in Main)

    and of course Tasks being an interface with the Loop(); and possibly other methods.

    Then I can easily create scripts like "KillCows" which will implement from Tasks

     

    Let me know what you guys think and your thoughts! 

    Thanks.

    Link to comment
    Share on other sites

    i dont really understand the question so this might be way off, but it sounds like you're describing using TaskScript rather than AbstractScript

     

     bottom of this thread explains how to use task script

    Link to comment
    Share on other sites

    8 hours ago, camalCase said:

    i dont really understand the question so this might be way off, but it sounds like you're describing using TaskScript rather than AbstractScript

     

     bottom of this thread explains how to use task script

    Okay wow! Thanks for the great link!

    That's exactly what I was going to implement myself.. It looks like dreambot has already though of and implemented this system!

    The only issue I see is how can I manage the selecting of "nodes"..

    It states you just simply add the nods in onStart() and it will select the nodes for you using their priority system and such..

    However, is there any way I can have full control of this selection process?

    And when it does make a selection on a node, it will go into its execution() loop. When does that come out? Also, how can I control it to stop that loop?

    Link to comment
    Share on other sites

    13 hours ago, Bryno said:

    However, is there any way I can have full control of this selection process?

     

    from task node you inherit public boolean accept() which you give the conditions for that node to run for example you have a banking node you want to run every time you have a full inv. do something like:

    public boolean accept() {
    return Inventory.isFull()
    }

    idk what more control youd want

     

    13 hours ago, Bryno said:

    And when it does make a selection on a node, it will go into its execution() loop. When does that come out? Also, how can I control it to stop that loop?

    with a return statement.

    when you return it doesnt run execute() again, its checks what node is accepted and then runs execute for that node. hopefully that makes sense

    Link to comment
    Share on other sites

    9 hours ago, camalCase said:

    from task node you inherit public boolean accept() which you give the conditions for that node to run for example you have a banking node you want to run every time you have a full inv. do something like:

    public boolean accept() {
    return Inventory.isFull()
    }

    idk what more control youd want

     

    with a return statement.

    when you return it doesnt run execute() again, its checks what node is accepted and then runs execute for that node. hopefully that makes sense

    Awesome, that's all the information I needed <3 

    Thanks again for all your knowledge :D 

    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.