Alakazizam Posted December 23, 2022 Share Posted December 23, 2022 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. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted December 23, 2022 Share Posted December 23, 2022 (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 December 23, 2022 by Khaleesi 1 Quote Link to comment Share on other sites More sharing options...
Czar Posted December 23, 2022 Share Posted December 23, 2022 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" 1 Quote Link to comment Share on other sites More sharing options...
Alakazizam Posted December 23, 2022 Author Share Posted December 23, 2022 Thanks, I think I can make Khaleesi's advice work for now by checking time until break. I need to learn how to make my own break handler, but I have a lot to learn. Not even sure how to go about starting something like that lol. Quote Link to comment Share on other sites More sharing options...