deiseldent 0 Posted April 29, 2013 Report Share Posted April 29, 2013 Someone had posted this code that does great job showing how to incorporate a pause, start, stop, and unpause button in your UI if your using html. I was wondering if someone could show us how to use the same concept if we were using stock UI buttons? I have been beating my head against this and cant get it to work... any help would be arrrrsome!!! heres the code... thanks in advance DD 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
AutomationNinja 194 Posted April 30, 2013 Report Share Posted April 30, 2013 why would you need it for the built in ui buttons? there is already start stop ect.... Quote Link to post Share on other sites
deiseldent 0 Posted April 30, 2013 Author Report Share Posted April 30, 2013 why would you need it for the built in ui buttons? there is already start stop ect.... Well the truth is that I am curious to see who has the solution... I simply couldn't figure it out after a whole day of testing. If I wanted to go the UI html route then that code is suffice, however I figured it would be a good reference for ubot users who are not accustomed to html and only want to stay within the stock features to have a look an alternative method. DD Quote Link to post Share on other sites
deiseldent 0 Posted April 30, 2013 Author Report Share Posted April 30, 2013 Well.. I want to apologize to this thread for the idiotic question... The answer was simply putting the pausebot, stopbot, and unpausebot within UI buttons and followng the same Stop Pause Check after each wait in your loop, 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.