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

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

  • Author

Updated with better error handling (allows you to determine if the account is banned etc.)

(note, how you use the snippet has also changed, see the example).

  • 2 weeks later...

This login handler is not working for me after the OSBot update today. Anyone else having this problem?

Ah. Is there nothing I can do about this. Perhaps an alternative to -allow norandoms?

EDIT: Nevermind. This has been fixed in the latest OSBot version.

Edited by dobin

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

  • Author

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

  • 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

  • 2 weeks later...

I had to comment out the stop/resume of the main ScriptExecutor because for some reason the primary script would not resume after login, it'd just stop -- I adjusted the script to fix but yeah incase anyone has issues you might need to adjust some things

  • 4 weeks later...
  • 1 month later...

@Explv

I am trying to get your LoginEvent to work using CLI, it is entering the password for the selected account however the username / email is not being changed from the previous session.

Do you have a work around or anything that can fix this issue?

Thanks

  • 1 year later...

Having a bug where this repeatedly clicks the "Cancel" then the "Existing User" button any suggestions?

  • 9 months later...

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

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.