Jump to content
UBot Underground

UI Stock Buttons vs. UI HTML buttons?


Recommended Posts

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")
}

Link to post
Share on other sites

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

Link to post
Share on other sites

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,

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...