Satan Posted June 9, 2019 Share Posted June 9, 2019 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 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 Quote Link to comment Share on other sites More sharing options...
Explv Posted November 1, 2019 Author Share Posted November 1, 2019 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). Quote Link to comment Share on other sites More sharing options...
Explv Posted November 1, 2019 Author Share Posted November 1, 2019 Updated again to handle locked accounts 1 Quote Link to comment Share on other sites More sharing options...
grammatoncleric Posted November 14, 2019 Share Posted November 14, 2019 Update request: - Handle for pvp worlds (id prefer not to login to these worlds myself) Quote Link to comment Share on other sites More sharing options...
Nand0 Posted November 21, 2019 Share Posted November 21, 2019 Thanks for this came in handy! Quote Link to comment Share on other sites More sharing options...
dobin Posted December 3, 2019 Share Posted December 3, 2019 This login handler is not working for me after the OSBot update today. Anyone else having this problem? Quote Link to comment Share on other sites More sharing options...
dobin Posted December 4, 2019 Share Posted December 4, 2019 (edited) 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 December 4, 2019 by dobin Quote Link to comment Share on other sites More sharing options...
grammatoncleric Posted December 5, 2019 Share Posted December 5, 2019 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 Quote Link to comment Share on other sites More sharing options...
Explv Posted March 15, 2020 Author Share Posted March 15, 2020 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 Quote Link to comment Share on other sites More sharing options...
gujarat6 Posted April 17, 2020 Share Posted April 17, 2020 (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 April 17, 2020 by gujarat6 Quote Link to comment Share on other sites More sharing options...
4head4head4head Posted April 29, 2020 Share Posted April 29, 2020 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 Quote Link to comment Share on other sites More sharing options...
Bloodycub Posted May 21, 2020 Share Posted May 21, 2020 When player disconects it dosent know the code need to add enum code for it Quote Link to comment Share on other sites More sharing options...
tehkingpenguin Posted July 9, 2020 Share Posted July 9, 2020 @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 Quote Link to comment Share on other sites More sharing options...
AssertVoid Posted September 13, 2021 Share Posted September 13, 2021 Having a bug where this repeatedly clicks the "Cancel" then the "Existing User" button any suggestions? Quote Link to comment Share on other sites More sharing options...
abc3 Posted July 12, 2022 Share Posted July 12, 2022 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! Quote Link to comment Share on other sites More sharing options...