Jump to content

Run function on break


Recommended Posts

Posted (edited)
2 hours ago, Alakazizam said:

Is there a way to have a function run when the break manager starts a break. I have a boolean I need reset whenever this happens.

Well you have 2 options here:
- Write your own breakhandler
- Use osbot break handler and try to set the boolean right before it starts the break, getBot().getTimeUntilNextBreak() returns the time in seconds left before it starts a break

Hope this helped

Edited by Khaleesi
  • Like 1
Posted

There is a way using custom break manager aka overriding the RandomSolver for breaks, you gotta make a new class and add extends RandomSolver, and in the constructor add


        super(RandomEvent.BREAK_MANAGER);

And then in onLoop you can treat it as a separate "script"

  • Like 1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...