Jump to content

A Simple Login Handler


Recommended Posts

Posted

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?

 

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

  • Like 1
Posted
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.

  • Like 2
  • 2 months later...
Posted
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

Posted
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

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

Posted (edited)
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

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