dubai Posted August 25 Share Posted August 25 (edited) Hi, i'm currently implementing a custom break handler in my scripts. This can be configured in the scriptGUI. all the logic seems to work apart from getting it to log back in? Can't see anything relevant in the api documentation or I'm not looking in the right places... Any help would be appreciated! In particular: Cannot resolve symbol 'LOGIN' api.getTabs().open(Tab.LOGIN); Here's might BreakHandler class: package extraFeatures; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.script.MethodProvider; import java.util.Random; public class BreakHandler { private final MethodProvider api; private final int minBotTime; private final int maxBotTime; private final int minBreakTime; private final int maxBreakTime; private long nextBreakTime; private final Random random; public BreakHandler(MethodProvider api, int minBotTime, int maxBotTime, int minBreakTime, int maxBreakTime) { this.api = api; this.minBotTime = minBotTime; this.maxBotTime = maxBotTime; this.minBreakTime = minBreakTime; this.maxBreakTime = maxBreakTime; this.random = new Random(); scheduleNextBreak(); } private void scheduleNextBreak() { long botTime = random.nextInt(maxBotTime - minBotTime + 1) + minBotTime; nextBreakTime = System.currentTimeMillis() + botTime * 60000L; } public boolean shouldTakeBreak() { return System.currentTimeMillis() >= nextBreakTime; } public void takeBreak() throws InterruptedException { long breakTime = random.nextInt(maxBreakTime - minBreakTime + 1) + minBreakTime; api.log("Taking a break for " + breakTime + " minutes."); api.getTabs().open(Tab.LOGOUT); MethodProvider.sleep(breakTime * 60000L); api.log("Break over, logging back in."); api.getTabs().open(Tab.LOGIN); /// THIS LINE NEEDS TO CHANGE? scheduleNextBreak(); } } Edited August 25 by dubai Quote Link to comment Share on other sites More sharing options...
dubai Posted August 25 Author Share Posted August 25 (edited) I can get the bot to log out and back in, however can't override the osbot break random solver... any tips! can't find any info for recent osbot versions Edited August 25 by dubai Quote Link to comment Share on other sites More sharing options...