Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Pausing Autologin

Featured Replies

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?

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.

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

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 by Antonio Kala

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:

 

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

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.

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

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

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

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.