roguehippo Posted December 4, 2017 Share Posted December 4, 2017 hello, im trying to logout when an enemy is seen. i can get to the log out function but when i call the code nothing happens. this is what im calling. if(logoutTab.logOut()) { sleep(150); pause(); } //logs out then pauses the script anyone got any ideas? Quote Link to comment Share on other sites More sharing options...
Muffins Posted December 4, 2017 Share Posted December 4, 2017 isnt it getLogoutTab().logOut(); ? Quote Link to comment Share on other sites More sharing options...
TheWind Posted December 5, 2017 Share Posted December 5, 2017 Just now, Muffins said: getLogoutTab().logOut(); use this, I believe it runs an event to open the logout tab, press the logout button, and stop the script. If your looking to pause the script and then log back in, you'd be better off using -norandoms and using your own login handler 1 Quote Link to comment Share on other sites More sharing options...
roguehippo Posted December 5, 2017 Author Share Posted December 5, 2017 the reason im not using that is because i already tried that first and it still didnt work Quote Link to comment Share on other sites More sharing options...
Shudsy Posted December 5, 2017 Share Posted December 5, 2017 Tried using stop();? Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted December 5, 2017 Share Posted December 5, 2017 12 minutes ago, Shudsy said: Tried using stop();? Stop doesn't logout, Just stops the script. Creating your own logout method wouldn't exactly be difficult though. if current tab != logout tab { // open logout tab } else { RS2Widget log = widget contains text "logout" if (log != null){ if (log.interact()){ // sleep until logged out } } } Quote Link to comment Share on other sites More sharing options...
Shudsy Posted December 5, 2017 Share Posted December 5, 2017 3 minutes ago, HeyImJamie said: Stop doesn't logout, Just stops the script. Creating your own logout method wouldn't exactly be difficult though. if current tab != logout tab { // open logout tab } else { RS2Widget log = widget contains text "logout" if (log != null){ if (log.interact()){ // sleep until logged out } } } Stop(); logs you out Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted December 5, 2017 Share Posted December 5, 2017 5 minutes ago, Shudsy said: Stop(); logs you out Ah yeah, It has a boolean method whether to stay logged in or not Quote Link to comment Share on other sites More sharing options...
roguehippo Posted December 5, 2017 Author Share Posted December 5, 2017 (edited) i know stop() works, but i didnt want it to stop the script. It would probably work for now. and i could create my own method by why have the method in the client in the first place if it doesnt work. im checking to see if its somehow related to how im calling it. ANSWER: I feel dumb. Instead of returning the true or false return value it was just returning false. but now the problem is that it will not pause the script after calling "pause();" (i need it to stay logged out instead of just instantly logging back in) Edited December 5, 2017 by roguehippo Quote Link to comment Share on other sites More sharing options...
d0zza Posted December 5, 2017 Share Posted December 5, 2017 3 hours ago, roguehippo said: i know stop() works, but i didnt want it to stop the script. It would probably work for now. and i could create my own method by why have the method in the client in the first place if it doesnt work. im checking to see if its somehow related to how im calling it. ANSWER: I feel dumb. Instead of returning the true or false return value it was just returning false. but now the problem is that it will not pause the script after calling "pause();" (i need it to stay logged out instead of just instantly logging back in) You could use a custom login handler instead then. Check out explv's one on the forums, it works very well. Quote Link to comment Share on other sites More sharing options...
The Undefeated Posted December 5, 2017 Share Posted December 5, 2017 (edited) 5 hours ago, roguehippo said: i know stop() works, but i didnt want it to stop the script. It would probably work for now. and i could create my own method by why have the method in the client in the first place if it doesnt work. im checking to see if its somehow related to how im calling it. ANSWER: I feel dumb. Instead of returning the true or false return value it was just returning false. but now the problem is that it will not pause the script after calling "pause();" (i need it to stay logged out instead of just instantly logging back in) Use a custom login handler for that or overwrite the break handler so it will break for x amount of time. Calling pause() is useless unless since you run a seperate thread to start it again. Edited December 5, 2017 by The Undefeated Quote Link to comment Share on other sites More sharing options...