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.

A Simple Login Handler

Featured Replies

Not sure if i do something wrong.

 

but when launching from CLI, i get this error.

ror executing event : testscript.LoginEvent@1538993
java.lang.NullPointerException
    at org.osbot.rs07.api.Widgets.getWidgetContainingText(bk:854)
    at testscript.LoginEvent.getLobbyButton(LoginEvent.java:133)
    at testscript.LoginEvent.execute(LoginEvent.java:30)
    at org.osbot.rs07.event.EventExecutor$2.run(ni:267)
    at org.osbot.rs07.event.EventExecutor.execute(ni:281)
    at org.osbot.rs07.script.MethodProvider.execute(kf:637)
    at testscript.LoginTest.onStart(LoginTest.java:18)
    at org.osbot.rs07.event.ScriptExecutor.IiIiIiiiiIiI(ti:266)
    at org.osbot.rs07.event.ScriptExecutor.start(ti:211)
    at org.osbot.Zb.run(ro:13)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 

when i just stop the same script and start it from osbot script manager, it works fine(account details pre-filled in the script)

any idea of what i do wrong?

 

22 minutes ago, Aap said:

Not sure if i do something wrong.

 

but when launching from CLI, i get this error.

ror executing event : testscript.LoginEvent@1538993
java.lang.NullPointerException
    at org.osbot.rs07.api.Widgets.getWidgetContainingText(bk:854)
    at testscript.LoginEvent.getLobbyButton(LoginEvent.java:133)
    at testscript.LoginEvent.execute(LoginEvent.java:30)
    at org.osbot.rs07.event.EventExecutor$2.run(ni:267)
    at org.osbot.rs07.event.EventExecutor.execute(ni:281)
    at org.osbot.rs07.script.MethodProvider.execute(kf:637)
    at testscript.LoginTest.onStart(LoginTest.java:18)
    at org.osbot.rs07.event.ScriptExecutor.IiIiIiiiiIiI(ti:266)
    at org.osbot.rs07.event.ScriptExecutor.start(ti:211)
    at org.osbot.Zb.run(ro:13)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 

when i just stop the same script and start it from osbot script manager, it works fine(account details pre-filled in the script)

any idea of what i do wrong?

 

The client hasn't loaded before trying to log in. Simplest way to do this would be to add a 15 second sleep before trying to log in. There are better ways ofcourse..

  • Author
11 hours ago, Aap said:

Not sure if i do something wrong.

 

but when launching from CLI, i get this error.

ror executing event : testscript.LoginEvent@1538993
java.lang.NullPointerException
    at org.osbot.rs07.api.Widgets.getWidgetContainingText(bk:854)
    at testscript.LoginEvent.getLobbyButton(LoginEvent.java:133)
    at testscript.LoginEvent.execute(LoginEvent.java:30)
    at org.osbot.rs07.event.EventExecutor$2.run(ni:267)
    at org.osbot.rs07.event.EventExecutor.execute(ni:281)
    at org.osbot.rs07.script.MethodProvider.execute(kf:637)
    at testscript.LoginTest.onStart(LoginTest.java:18)
    at org.osbot.rs07.event.ScriptExecutor.IiIiIiiiiIiI(ti:266)
    at org.osbot.rs07.event.ScriptExecutor.start(ti:211)
    at org.osbot.Zb.run(ro:13)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 

when i just stop the same script and start it from osbot script manager, it works fine(account details pre-filled in the script)

any idea of what i do wrong?

 

 

10 hours ago, k9thebeast said:

The client hasn't loaded before trying to log in. Simplest way to do this would be to add a 15 second sleep before trying to log in. There are better ways ofcourse..

 

You could try checking getBot().isLoaded()

I will try it out myself tonight and update the snippet usage.

I also have some additional account status checks I will be adding to the handler.

2 hours ago, Explv said:

 

 

You could try checking getBot().isLoaded()

I will try it out myself tonight and update the snippet usage.

I also have some additional account status checks I will be adding to the handler.

Hype, More spoonfeed 4 me :doge: 

2 hours ago, Explv said:

 

 

You could try checking getBot().isLoaded()

I will try it out myself tonight and update the snippet usage.

I also have some additional account status checks I will be adding to the handler.

Oooo hook it up. Pls 

@Explv

No guarantee this works as I havent used it in a while, but found something in one of my older scripts.

 

sleepUntil(20, () -> !client.getLoginStage().equals(null));

 

Edited by k9thebeast

  • 2 months later...
On 6/9/2017 at 9:11 AM, Explv said:

 

 

You could try checking getBot().isLoaded()

I will try it out myself tonight and update the snippet usage.

I also have some additional account status checks I will be adding to the handler.

I see you never updated the original thread.

 
I ran into the same issue today but I just added some code to fix it. 

Just letting you know incase you wanted to update OP :P

Had this small problem myself and found a fix.

The event is blocking. The LoginResponseCodeListener is delayed because of this by a minute or so. 

set the loginEvent to async and it'll solve that problem.

Anyone else have a problem that it not always logs back in after being logged out due inactivity or just before bans?

Happens like 30% of the time.

Pseudo usage:

int onLoop() {
	if (client.isLoggedIn()) {
		doStuff();
	else {
		execute(loginEvent);
	}
}

Just stays logged out. Pausing and resuming the script helps

On 9/8/2017 at 3:32 AM, nosepicker said:

Anyone else have a problem that it not always logs back in after being logged out due inactivity or just before bans?

Happens like 30% of the time.

Pseudo usage:


int onLoop() {
	if (client.isLoggedIn()) {
		doStuff();
	else {
		execute(loginEvent);
	}
}

Just stays logged out. Pausing and resuming the script helps

Yeah was happening to me too on like 1/10 accounts, but it stopped now for some reason

9 hours ago, Juggles said:

Yeah was happening to me too on like 1/10 accounts, but it stopped now for some reason

Still happening to me in 1.4.138. I think it has something to do with osbot threads. Seems like loginEvent doesn't always fire when it's logged out. Pausing and resuming the script helps.

On 9/14/2017 at 2:35 AM, nosepicker said:

Still happening to me in 1.4.138. I think it has something to do with osbot threads. Seems like loginEvent doesn't always fire when it's logged out. Pausing and resuming the script helps.

Did you find a solution to this? It's happening to me again every once in a while.

47 minutes ago, Juggles said:

Did you find a solution to this? It's happening to me again every once in a while.

not a 100% one but seems to work. Based on guesses mostly. If you get logged out while doing webwalking or some other activity that's basically a loop and requires being logged in, that activity doesn't really end. I've made sure that all these activities stop executing if the bot is logged out. Saw only 1 bot fail out of 100 so far.

21 hours ago, nosepicker said:

not a 100% one but seems to work. Based on guesses mostly. If you get logged out while doing webwalking or some other activity that's basically a loop and requires being logged in, that activity doesn't really end. I've made sure that all these activities stop executing if the bot is logged out. Saw only 1 bot fail out of 100 so far.

How do you stop executing activities? 
Like I've found some in the middle of fishing just randomly logged out. It should have switched to login event but rather just stayed in the fishing loop doing nothing. I thought these kinds of things would automatically stop. 

Edited by Juggles

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.