flewis Posted February 16, 2018 Share Posted February 16, 2018 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 -Flewis Quote Link to comment Share on other sites More sharing options...
Jammer Posted February 16, 2018 Share Posted February 16, 2018 (edited) I believe it should login automatically after that sleep. Edited February 16, 2018 by Jammer Quote Link to comment Share on other sites More sharing options...
Alek Posted February 16, 2018 Share Posted February 16, 2018 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. Quote Link to comment Share on other sites More sharing options...
Juggles Posted February 16, 2018 Share Posted February 16, 2018 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 Quote Link to comment Share on other sites More sharing options...
flewis Posted February 16, 2018 Author Share Posted February 16, 2018 (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 February 16, 2018 by flewis Quote Link to comment Share on other sites More sharing options...
nano mano Posted February 21, 2018 Share Posted February 21, 2018 Check useful snippets and you will find it. Anyways, here it is Good luck! Quote Link to comment Share on other sites More sharing options...