Jump to content

Logging out then back in after some time.


Recommended Posts

Posted

Hey'a everyone,

 

I can't find a way to log out wait some time then log back in, the code I have so far is:

getLogoutTab().logOut(); // Logs out
sleep(random(25000, 30000)); // Ignore the time I'll change this later
AutoLogin(); // <------------ this doesn't work for some reason and just comes up with an error

'AutoLogin();' is what is used on the OSBOT documentation.

Thanks for any response <3

-Flewis

Posted

AutoLogin() isn't a method, it's the initializer for a class. Your script only runs when your fully logged into the game to prevent new scripters from easily throwing null pointers and crashing the client. I'd suggest first learning a bit of Java and how objects are constructed before attempting to do something like this. If you still want to go ahead without learning the necessary knowledge, you will need to start OSBot with -norandoms enabled so you can execute code at the login screen.

Posted (edited)
35 minutes ago, Alek said:

AutoLogin() isn't a method, it's the initializer for a class. Your script only runs when your fully logged into the game to prevent new scripters from easily throwing null pointers and crashing the client. I'd suggest first learning a bit of Java and how objects are constructed before attempting to do something like this. If you still want to go ahead without learning the necessary knowledge, you will need to start OSBot with -norandoms enabled so you can execute code at the login screen.

Yeah sorry that was me just being stupid, thank you for the heads up I am fairly new to scripting in Java and I have gone pretty big for a first project but everything has been successful so far. Also how do I start OSBOT with -norandoms?

26 minutes ago, Juggles said:

You need to create your own login handler class or use Explvs if you want to do that. 

A lot more code to it then just sleeping when you log out

Okay thank you, could you link me to Explv's login handler class, he has so many resources. 

Edited by flewis

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