Jump to content

A Simple Login Handler


Explv

Recommended Posts

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?

 

Link to comment
Share on other sites

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

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

  • 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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