Jump to content
UBot Underground

A command to Initiate Script (Like the Run button)


Recommended Posts

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

Link to post
Share on other sites

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