Jump to content

A Simple Login Handler


Explv

Recommended Posts

On 7/26/2018 at 8:15 AM, Pegasus said:

When I run it, it shows NullPointerException immediately.

 

Script doesn't start if account hasn't logined / I turned off client auto login?:???:

onstart not being called before user is logged :feels:


Uncaught exception!
java.lang.NullPointerException
	at org.osbot.rs07.event.ScriptExecutor$3.run(kl:211)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

 

Getting the same error :(

Link to comment
Share on other sites

  • 2 weeks later...

I've added/implemented (and got this to work) the script above to my main.java in the onLoop method, however, this only works for the first login, and I cant figure out how to make the account re-log back in to get another login code, suchas when I am banned and forcibly logged out. I get the error code 5, and I have my script setup so it tries and log back in, using the same method as onStart does (and I know this works because the bot wont login if i comment this out). How I am logging in via onStart is with loginToAccount(email, pass)

SUMMARY: if forcibly logged out, how do I get an error code, because the error code that is given when logged out is always a five, which means the account is already logged in, and this isnt a real error code that is associated with the account, usually it is either locked (18) or banned (dono the code). Thank you in advance! Feel free to dm me on discord nubonix#3648

Link to comment
Share on other sites

Added fix for cases where sometimes the lobby screen is skipped and causes the login handler to hang for 30s.

Fix was to add 

getClient().isLoggedIn() ||

On line 210 of LoginEvent.

This breaks the 30s conditional sleep when the client is logged in, regardless of whether the lobby screen button is visible

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I'm not sure what is causing this but the script starts running before the account is logged in. I have loginToAccount in onStart(), but the script jumps to onLoop even before it finishes logging in. This didn't happen before, started just now, but I didn't change anything in my script.

Edited by gujarat6
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 1 year later...
  • 9 months 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...