Monovski 4 Posted November 10, 2017 Report Share Posted November 10, 2017 Hello all, I have question how to stop bot process when define is running thanks so much Quote Link to post Share on other sites
darryl561 177 Posted November 10, 2017 Report Share Posted November 10, 2017 I can't find the thread and can't remember who shared it but I had saved this stop/pause/resume code: ui html panel("<button onclick=\"ubot.runScript(\'run_bot()\')\">Start</button> <button onclick=\"ubot.runScript(\'stopbot()\')\">Stop</button> <button onclick=\"ubot.runScript(\'pausebot()\')\">Pause</button> <button onclick=\"ubot.runScript(\'un_pausebot()\')\">Un-Pause</button>",300) define run_bot { load html("Hey") wait(1) Stop Pause Check() load html("I") wait(1) Stop Pause Check() load html("Hope") wait(1) Stop Pause Check() load html("This") wait(1) Stop Pause Check() load html("Helps") wait(1) Stop Pause Check() load html("You") wait(1) Stop Pause Check() load html("Understand") Stop Pause Check() load html("How") Stop Pause Check() load html("To") Stop Pause Check() load html("Pause") Stop Pause Check() load html("and Un Pause") Stop Pause Check() load html("Your Bot") } define Check Stop { if($comparison(#stopnow,"=",$true)) { then { set(#stopnow,$false,"Global") stop script } else { } } } define Check Pause { if($comparison(#pause,"=",$true)) { then { wait(1) Check Pause() } else { } } } define Stop Pause Check { Check Stop() Check Pause() } define pausebot { set(#pause,$true,"Global") } define un_pausebot { set(#pause,$false,"Global") } define stopbot { set(#stopnow,$true,"Global") } Quote Link to post Share on other sites
Brutal 164 Posted November 11, 2017 Report Share Posted November 11, 2017 if you are just right-clicking and selecting to run the define that way - There is no stopping it other than to just exit ubot. If you are starting it via the run button, then the stop/pause buttons will work for you. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.