August 18, 20187 yr For my script I am wanting it to log out but then stay logged out for an X amount of time before logging back in. For this I need to disable the auto login temporarily. I would prefer not using a custom login handler, does anyone have a solution for this?
August 18, 20187 yr A hacky way would be to pause the ScriptExecutor. You can check when you should resume it again in a different running thread. This is not the most beautiful way to do it though.
August 18, 20187 yr Author 2 hours ago, Juggles said: Use break handler. Does exaxtly what you want How do you do that? 1 hour ago, Antonio Kala said: Go to settings and then turn on breaks. Is there a reason you can't use those? I'm wanting to do this through the script code, not set it through the client.
August 18, 20187 yr 36 minutes ago, someguy567 said: How do you do that? I'm wanting to do this through the script code, not set it through the client. Then you can use -allow no randoms with cli and handle logging in/breaking. Edited August 18, 20187 yr by Antonio Kala
August 18, 20187 yr Author That's not what I want to do though, I'm looking to achieve the effect via code
August 18, 20187 yr 2 hours ago, someguy567 said: That's not what I want to do though, I'm looking to achieve the effect via code You can override the Break Manager via code:
August 19, 20187 yr Author How does that work though? Do I need to be in a break currently or what? I don't really understand. Can someone help out?
August 21, 20187 yr On 8/19/2018 at 10:07 PM, someguy567 said: How does that work though? Do I need to be in a break currently or what? I don't really understand. Can someone help out? You make a custom BreakManager by creating a new class which extends RandomSolver. In the newly created BreakManager class you will handle the logic of when the BreakManager should be activated, you do this in the #shouldActivate method. Make sure that you don't forget to override the OSBot Break RandomSolver with your newly created one.
August 21, 20187 yr Author 3 hours ago, Eagle Scripts said: You make a custom BreakManager by creating a new class which extends RandomSolver. In the newly created BreakManager class you will handle the logic of when the BreakManager should be activated, you do this in the #shouldActivate method. Make sure that you don't forget to override the OSBot Break RandomSolver with your newly created one. Alright, so I have this. import org.osbot.rs07.script.RandomEvent; import org.osbot.rs07.script.RandomSolver; public class BreakManager extends RandomSolver { public BreakManager(RandomEvent arg0) { super(arg0); } @Override public boolean shouldActivate() { return true; } @Override public int onLoop() throws InterruptedException { return 1000; } } private final BreakManager breaks = new BreakManager(RandomEvent.BREAK_MANAGER); getBot().getRandomExecutor().overrideOSBotRandom(breaks); Then I have those two lines in the class I'm trying to use the break in. I tried it and it came up with the popup to let me know I'm overrriding the break manager but on the debug log there was something that I don't think should have happened. Since the bot didn't actually go on break and it came up with this error. https://prnt.sc/kl6h0e <--- Screenshot Is there something I am missing?
August 21, 20187 yr 44 minutes ago, someguy567 said: Alright, so I have this. import org.osbot.rs07.script.RandomEvent; import org.osbot.rs07.script.RandomSolver; public class BreakManager extends RandomSolver { public BreakManager(RandomEvent arg0) { super(arg0); } @Override public boolean shouldActivate() { return true; } @Override public int onLoop() throws InterruptedException { return 1000; } } private final BreakManager breaks = new BreakManager(RandomEvent.BREAK_MANAGER); getBot().getRandomExecutor().overrideOSBotRandom(breaks); Then I have those two lines in the class I'm trying to use the break in. I tried it and it came up with the popup to let me know I'm overrriding the break manager but on the debug log there was something that I don't think should have happened. Since the bot didn't actually go on break and it came up with this error. https://prnt.sc/kl6h0e <--- Screenshot Is there something I am missing? You must override the getName method. Additionally, this will not log you out or draw a paint.. or ever stop breaking again; you have to implement all that logic yourself. Alternatively, to simplify the process, you can extend the existing BreakManager class instead of RandomSolver, in order to re-use the OSBot built in break manager, but simply override when it should activate. This however, will fail if breaks are disabled in client settings, so you must check if there is already an existing break manager registered first; and also don't forget to exchange contexts with your new BreakManager before registering it. Edited August 21, 20187 yr by FrostBug
August 21, 20187 yr 45 minutes ago, someguy567 said: Alright, so I have this. import org.osbot.rs07.script.RandomEvent; import org.osbot.rs07.script.RandomSolver; public class BreakManager extends RandomSolver { public BreakManager(RandomEvent arg0) { super(arg0); } @Override public boolean shouldActivate() { return true; } @Override public int onLoop() throws InterruptedException { return 1000; } } private final BreakManager breaks = new BreakManager(RandomEvent.BREAK_MANAGER); getBot().getRandomExecutor().overrideOSBotRandom(breaks); Then I have those two lines in the class I'm trying to use the break in. I tried it and it came up with the popup to let me know I'm overrriding the break manager but on the debug log there was something that I don't think should have happened. Since the bot didn't actually go on break and it came up with this error. https://prnt.sc/kl6h0e <--- Screenshot Is there something I am missing? Your BreakManager does not have a #getName function, every RandomSolver should have one, the client is trying to execute that method but it's not there, hence the NPE.
September 4, 20187 yr Author You know that popup that appears warning you that you have a custom break manager? Is there a way to automatically press ok on that, since my script won't begin without clicking ok
September 4, 20187 yr 11 hours ago, someguy567 said: You know that popup that appears warning you that you have a custom break manager? Is there a way to automatically press ok on that, since my script won't begin without clicking ok No, this will never be possible.
Create an account or sign in to comment