Jump to content

Pausing Autologin


Recommended Posts

Posted
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.

Posted
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?

Posted (edited)
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 by FrostBug
  • Like 1
Posted
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.

  • 2 weeks later...

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...