Jump to content

A Simple Login Handler


Recommended Posts

Posted
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 :(

  • 2 weeks later...
Posted

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

Posted

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
  • 1 month later...
Posted (edited)

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

It gets stuck on the account banned screen so I added pressing the back button:

private static final Rectangle BACK_BUTTON = new Rectangle(320, 313, 120, 20);
private void login() {
    ...
        case 14:
            clickButton(BACK_BUTTON);
            break;
    }
}

Everything else is working great so far!

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