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

    Is there a way to set a break from the code?

     

    I used to use sleep to break, but not that disconnects from dreambot and stops the script:

     

    5:52:25 AM: [ERROR] There was an issue connecting to our servers

    Posted

    Dreambot has a built in break manager. You can access this from the client directly located at the bottom of the client 

    Posted

    @MaximusPrimothanks but that was not the question. You can't set a time to sleep at night and that break also has issues like if in combat sometimes it will keep trying to break, or the character might die because it just went on a break.

     

    Im looking to take a break from the script programically 

    • 3 weeks later...
    Posted

    🤔 I just use sleeps, did they change something so that it doesn't work anymore then? 

    • 1 month later...
    Posted
        private void toggleLogin(boolean enable){
            if(enable)
                getRandomManager().enableSolver("Login Handler");
            else
                getRandomManager().disableSolver("Login Handler");
        }

    then when it's break time just toggleLogin(false)

    when its time to resume toggleLogin(true)

    I know it's a little late but I just got here today, hope this helps someone.

    • 4 months later...
    Posted

    sleep();// Mins, Hours, Days, will just idle until it auto logs out due to inactivity.

    Once released from the break.

    sleep();//Sleep while the login handler is logging your bot back in, before your code continues.

    The bot will resume itself where it left off.

    • 2 weeks later...
    Posted

    I've tried evoking the existing getRandomManager instance from a sub-script with `ScriptManager.getScriptManager().getCurrentScript().getRandomManager().disableSolver(RandomEvent.LOGIN)` but it still manages to automatically log in while the script is sleeping itself.

     

    With that not doing the trick I'm not sure how else to tackle this.

    Posted
    15 hours ago, iPaq said:

    I've tried evoking the existing getRandomManager instance from a sub-script with `ScriptManager.getScriptManager().getCurrentScript().getRandomManager().disableSolver(RandomEvent.LOGIN)` but it still manages to automatically log in while the script is sleeping itself.

     

    With that not doing the trick I'm not sure how else to tackle this.

    This works just fine for me
    "

    getRandomManager().disableSolver(RandomEvent.LOGIN)

    "

    • 3 months later...
    Posted

    Instead of using sleep, try setting up a loop that checks the time. I’ve done something similar, where I store the start time and then keep checking until a certain amount of time has passed. This way, you can pause without getting disconnected from DreamBot. It’s worked well for me, and it gives you a bit more control without stopping the script entirely.

    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.