Jump to content
UBot Underground

Run Script from UI - NOB Question


Recommended Posts

Hello. I'm not sure what the heck I'm doing wrong but I'm tired of wasting time on this simple thing. I just need to run the script from a button in the user interface. I thought it was the code below but it isn't working.... Can someone please show some examples of the correct command?

button onclick=\ubot.runScript
Link to post
Share on other sites

In the UI HTML panel try something like this:

 

<p><center><button onclick=\"ubot.runScript(\'Go()\')\">Start</button> || <button onclick=\"ubot.runScript(\'stop()\')\">Stop</button></center></p>

 

 

 


 

Link to post
Share on other sites

errr... this is so frustrating. I'm using a user interface drag and drop program so that might be messing me up more. Here is the code I have. Does it look correct?

 

<button style="height: 100px; width: 200px; font-family: 'Comic Sans MS'; font-size: 23px; color: rgb(0, 0, 0); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; " onmouseover="this.style.background='#FF0829'" onmouseout="this.style.background='#FFFFFF'" onclick=\"ubot.runScript(\'masterblaster()\')\">BEGIN BLASTING!</button>

Link to post
Share on other sites

<button style="height: 100px; width: 200px; font-family: 'Comic Sans MS'; font-size: 23px; color: rgb(0, 0, 0); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; " onmouseover="this.style.background='#FF0829'" onmouseout="this.style.background='#FFFFFF'"

onclick="ubot.runScript('masterblaster()')">BEGIN BLASTING!</button>

Link to post
Share on other sites

I guess i am looking for same answer please help any1

 LazyBotter already did.

 

Open up a bot, go to "code view" and paste the code below into it. You will be able to see visually how it works.

 

ui html panel("<button style=\"height: 100px; width: 200px; font-family: \'Comic Sans MS\'; 
font-size: 23px; color: rgb(0, 0, 0); 
background-image: initial; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); 
background-position: initial initial; background-repeat: initial initial; 
\" onmouseover=\"this.style.background=\'#FF0829\'\" onmouseout=\"this.style.background=\'#FFFFFF\'\"
onclick=\"ubot.runScript(\'masterblaster()\')\">BEGIN BLASTING!</button>", "")
define masterblaster {
    navigate("http://www.google.com/", "Wait")
}
Link to post
Share on other sites

I am STILL stuck on this. Can someone, anyone explain what the hell I am doing wrong before I throw my computer against the wall?!

 

It sounds like you are trying to create a button in the 'load html' node. If that is the case, check out the attached bot.

button.ubot

Link to post
Share on other sites

looks good but what if i want to use regular input ui text box and submit button... how then you ccan make that button triggerer on click the next function is click

Link to post
Share on other sites

looks good but what if i want to use regular input ui text box and submit button... how then you ccan make that button triggerer on click the next function is click

 

Try this:

ui html panel("<input name=\"ButtonName\" type=\"text\" variable=\"#ButtonName\" fillwith=\"value\" placeholder=\"Button Text\" /><br>
<td><button class=\"Submit\" onclick=\"ubot.runScript(\'submitDefine()\')\">Submit</button></td>", 350)
define submitDefine {
    navigate("google.com", "Wait")
}

For a nicer looking submit button, visit:

http://www.ubotstudio.com/forum/index.php?/topic/13044-sell-css-ui-button-creator-for-dev-edition/

 

 

(sorry- couldn't resist the shameless plug)

Link to post
Share on other sites

define stop {
    set(#stop, 0, "Global")
}
ui html panel("<!DOCTYPE html>
<html>

<head>
<meta charset=\'UTF-8\'>

<title>CSS Tables by Theodore Gaushas - BotGuru.net</title>
<!--
THIS COPYRIGHT NOTICE MUST REMAIN
Created by: Theodore Gaushas
Website: http://www.botguru.net
Date: 12/11/2011

For use with Ubot Studio v4
Rights: Copyright to Theodore Gaushas of Botguru.net
Usage Rights: You are allowed to use this in Unlimited Projects so long as this copyright remains
-->

<!--
INSTRUCTIONS
1. Open Ubot
2. Drag in UI HTML node
3. Insert this entire document (before or after editing)
4. Set Heigth to 250
5. Hit OK
-->

<!--
variable=\"#textareaexample\" fillwith=\"value\"

variable is the name variable you will use in Ubot to use the information from the UI area

fillwith is the information entered to each object. This might not in all cases be value, but can also be checked,innertext,etc.

-->
<style>
* \{ margin: 0; padding: 0; \}
#page-wrap \{ width: 100%px; margin: 50px auto; \}
h1 \{ font: 36px Georgia, Serif; margin: 20px 0; \}
.group:after \{ visibility: hidden; display: block; font-size: 0; content: \" \"; clear: both; height: 0; \}
p \{ margin: 0 0 10px 0; \}

.tabs \{ list-style: none; \}
.tabs li \{ display: inline; \}
.tabs li a \{ color: black; float: left; display: block; padding: 4px 10px; ; position: relative; left: 1px; background: white; text-decoration: none; \}
.tabs li a:hover \{ background: #ccc; color: black;\}


/* Generic styles & example one */

.tabbed-area \{ margin: 0 0 0px 0; \}
.box-wrap \{ position: relative; min-height: 180px; \}
.tabbed-area div div \{ background: white; padding: 20px; min-height: 180px; position: absolute; top: -1px; left: 0; width: 100%; \}
.tabbed-area div div, .tabs li a \{ border: 1px solid #ccc; \}
#box-one:target, #box-two:target, #box-three:target, #box-four:target, #box-five:target, #box-six:target, #box-seven:target, #box-eight:target, #box-nine:target  \{ z-index: 1; \}

/* buttons */
.cssbutton \{
    -moz-box-shadow:inset 0px 1px 0px 0px #E3A869
    -webkit-box-shadow:inset 0px 1px 0px 0px #E3A869;
    box-shadow:inset 0px 1px 0px 0px #E3A869;
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #FF8C00), color-stop(1, #FF7F00) );
    background:-moz-linear-gradient( center top, #FF8C00 5%, #FF7F00 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=\'#FF8C00\', endColorstr=\'#FF7F00\');
    background-color:#FF8C00;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;
    border-radius:6px;
    border:1px solid ##EE7600;
    display:inline-block;
    color: #000000;
    font-family:arial;
    font-size:15px;
    font-weight:bold;
    padding:6px 24px;
    text-decoration:none;
    text-shadow:1px 1px 0px #ED9121;
\}.cssbutton:hover \{
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #FF7F00), color-stop(1, #FF8C00) );
    background:-moz-linear-gradient( center top, #FF7F001 5%, #FF8C00 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=\'#FF7F00\', endColorstr=\'#FF8C00\');
    background-color:#FF7F00;
\}.cssbutton:active \{
    position:relative;
    top:1px;
\}
.saveclass \{
    -moz-box-shadow:inset 0px 1px 0px 0px #cae3fc;
    -webkit-box-shadow:inset 0px 1px 0px 0px #cae3fc;
    box-shadow:inset 0px 1px 0px 0px #cae3fc;
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #4197ee) );
    background:-moz-linear-gradient( center top, #79bbff 5%, #4197ee 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=\'#79bbff\', endColorstr=\'#4197ee\');
    background-color:#79bbff;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;
    border-radius:6px;
    border:1px solid #469df5;
    display:inline-block;
    color:#ffffff;
    font-family:arial;
    font-size:15px;
    font-weight:bold;
    padding:6px 24px;
    text-decoration:none;
    text-shadow:1px 1px 0px #287ace;
\}.saveclass:hover \{
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4197ee), color-stop(1, #79bbff) );
    background:-moz-linear-gradient( center top, #4197ee 5%, #79bbff 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=\'#4197ee\', endColorstr=\'#79bbff\');
    background-color:#4197ee;
\}.saveclass:active \{
    position:relative;
    top:1px;
\}
</style>

<script language=\"javascript\">
function toggle(spanId) \{
var spanArray = document.getElementsByTagName(\"span\");
for(i = 0; i < spanArray.length; i++)\{
if(spanArray.id == spanId)\{
if(spanArray.style.display != \'none\')\{
spanArray.style.display = \'none\';
\}else\{
spanArray.style.display = \'\';
\}
\}
\}
\}
</script>

</head>

<body>


            
<p><center><button class=\"cssbutton\" onclick=\"ubot.runScript(\'Go()\')\">Start</button> || <button class=\"cssbutton\" onclick=\"ubot.runScript(\'stop()\')\">Stop</button></center></p>

<p><center variable=\"#status\" fillwith=\"innertext\"></p>


<script type=\"text/javascript\">
    window.onload = ubot.runScript(\'definesub()\')
</script>




</body>
</html>
", 280)
define Go {
    navigate("http://wiki.ubotstudio.com/wiki/Standard_Edition""Wait")
}
define definesub {
    stop script
}

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...