dokato Posted June 24, 2016 Posted June 24, 2016 Is there a way to disable the auto login? I want my script to perform breaks on its own, because the bot doesnt break well with combat scripts. If the bot logins automatically right after logout it wont work. Any way of overriding or changing something?
Fruity Posted June 24, 2016 Posted June 24, 2016 dont select an acc when you load the client and start script logged in 1
Harry Posted June 24, 2016 Posted June 24, 2016 dont select an acc when you load the client and start script logged in
FrostBug Posted June 24, 2016 Posted June 24, 2016 You can override shouldActivate to verify with your script whether or not now is a good time to start a break try { this.bot.getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.BREAK_MANAGER) { @Override public boolean shouldActivate() { return super.shouldActivate() && canStartBreak(); } }); } catch (Exception ex) { //Break manager is not enabled log("Failed to modify break handler"); } It's up to you to implement the canStartBreak method
dokato Posted June 24, 2016 Author Posted June 24, 2016 You can override shouldActivate to verify with your script whether or not now is a good time to start a break try { this.bot.getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.BREAK_MANAGER) { @Override public boolean shouldActivate() { return super.shouldActivate() && canStartBreak(); } }); } catch (Exception ex) { //Break manager is not enabled log("Failed to modify break handler"); } It's up to you to implement the canStartBreak method I get this error if i try to do that: The type org.osbot.rs07.event.RandomExecutor cannot be resolved. It is indirectly referenced from required .class files
FrostBug Posted June 24, 2016 Posted June 24, 2016 I get this error if i try to do that: The type org.osbot.rs07.event.RandomExecutor cannot be resolved. It is indirectly referenced from required .class files Acquire a better IDE #EclipseSux 2
LoudPacks Posted June 24, 2016 Posted June 24, 2016 I get this error if i try to do that: The type org.osbot.rs07.event.RandomExecutor cannot be resolved. It is indirectly referenced from required .class files Clean your project, remove osbot from buildpath and re add it, restart eclipse. 1
dokato Posted June 24, 2016 Author Posted June 24, 2016 Clean your project, remove osbot from buildpath and re add it, restart eclipse. Acquire a better IDE #EclipseSux Okay thx, and should I implement it in onStart() or onLoop() ? Knowing that onStart() only gets executed after login.
LoudPacks Posted June 24, 2016 Posted June 24, 2016 Okay thx, and should I implement it in onStart() or onLoop() ? Knowing that onStart() only gets executed after login. onStart since it only needs to be set once. 1
dokato Posted June 26, 2016 Author Posted June 26, 2016 (edited) @FrostBug @LoudPacks Ok thanks guys, I've managed to override the auto login, now I've got my own break system that works. Edited June 26, 2016 by dokato