abdulr 0 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
ozeki6 32 Posted January 5, 2019 You don't have to. Just do this : public void onStop() { log("Script is stopped"); }
abdulr 0 Author 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
ozeki6 32 Posted January 5, 2019 boolean isScriptRunning = true; public void onStop() { isScriptRunning = false; } while(isScriptRunning) { }
Just Chill 26 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.