abdulr 0 Share Posted January 5, 2019 how can i check if the script is still running (in code). so essentially if i manually stop the script, i want it to print false as in script is stopped Link to comment Share on other sites More sharing options...
ozeki6 32 Share Posted January 5, 2019 You don't have to. Just do this : public void onStop() { log("Script is stopped"); } Link to comment Share on other sites More sharing options...
abdulr 0 Author Share Posted January 5, 2019 1 hour ago, ozeki6 said: You don't have to. Just do this : public void onStop() { log("Script is stopped"); } well i need to know because, if im running a while loop and i stop the script, the bot will continue to do whatever its doing over and over, but if im able to check if it is not running then break out the loop Link to comment Share on other sites More sharing options...
ozeki6 32 Share Posted January 5, 2019 boolean isScriptRunning = true; public void onStop() { isScriptRunning = false; } while(isScriptRunning) { } Link to comment Share on other sites More sharing options...
Just Chill 26 Share Posted January 5, 2019 Could try using the ScriptManager class with getState() or isRunning() haven't used them before but it seems to be what you're looking for. The documentation on it can be found here. Link to comment Share on other sites More sharing options...
Nuclear Nezz 1926 Share Posted January 5, 2019 what chill said. You can check through scriptmanager. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now