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

    Recommended Posts

    Posted

    Hi, I have a general question about coding scripts for dreambot.

    I've been using switch with game conditions like Players.getLocal().isMoving() or furnace.exists() etc, to determine what sequence the script should be executing.

    I recently had to use a boolean to stop my cases from overlapping conditions and causing errors or the script to execute the wrong actions.

    Is this a good way to do this? Or is there a different method I could use to improve efficiency and not use 4-5 conditions to define a case? Thanks!

    • 1 month later...
    Posted

    Another way to streamline it might be using a state machine pattern, where each state represents a specific task and the transition between states is based on game conditions. 

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.