Jump to content
flewis

Logging out then back in after some time.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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