Jump to content

Pausing Autologin


someguy567

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...