automaton 2 Posted December 29, 2013 Report Share Posted December 29, 2013 I want to eliminate the navigation bar with the run/pause/stop buttons, and integrate my own buttons to perform the same functions. Basicly trying to clean up my UI. Is there a command that will "run" the script that i can link to a button on the UI? Have been looking through the forums and havent found anything on this. (It's probably something simple that I am overthinking LOL) Any help is appreciated Quote Link to post Share on other sites
giganut 109 Posted December 30, 2013 Report Share Posted December 30, 2013 This should help you, It's not my code, but I can't remeber where in the furom I got it from, lol 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
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.