JackCrow 4 Posted March 26, 2013 Report Share Posted March 26, 2013 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 Quote Link to post Share on other sites
AutomationNinja 194 Posted March 26, 2013 Report Share Posted March 26, 2013 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> Quote Link to post Share on other sites
JackCrow 4 Posted March 26, 2013 Author Report Share Posted March 26, 2013 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> Quote Link to post Share on other sites
JackCrow 4 Posted March 26, 2013 Author Report Share Posted March 26, 2013 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?! Quote Link to post Share on other sites
JackCrow 4 Posted March 26, 2013 Author Report Share Posted March 26, 2013 I just need to run a script when the user clicks a button. This should be simple but I'm not a coder and I need help. Please! Quote Link to post Share on other sites
LazyBotter 188 Posted March 27, 2013 Report Share Posted March 27, 2013 <button onclick="ubot.runScript('Your Define Here()')">Start</button> The button will call your define command... Quote Link to post Share on other sites
LazyBotter 188 Posted March 27, 2013 Report Share Posted March 27, 2013 <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> Quote Link to post Share on other sites
AutomationNinja 194 Posted March 27, 2013 Report Share Posted March 27, 2013 so define a command called go and put your commands inside of that. Quote Link to post Share on other sites
newcoder 5 Posted March 27, 2013 Report Share Posted March 27, 2013 I guess i am looking for same answer please help any1 Quote Link to post Share on other sites
darryl561 177 Posted March 27, 2013 Report Share Posted March 27, 2013 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") } Quote Link to post Share on other sites
jomark3 25 Posted March 27, 2013 Report Share Posted March 27, 2013 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 Quote Link to post Share on other sites
newcoder 5 Posted March 27, 2013 Report Share Posted March 27, 2013 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 Quote Link to post Share on other sites
jomark3 25 Posted March 27, 2013 Report Share Posted March 27, 2013 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) Quote Link to post Share on other sites
AutomationNinja 194 Posted March 27, 2013 Report Share Posted March 27, 2013 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 REMAINCreated by: Theodore GaushasWebsite: http://www.botguru.netDate: 12/11/2011For use with Ubot Studio v4Rights: Copyright to Theodore Gaushas of Botguru.netUsage Rights: You are allowed to use this in Unlimited Projects so long as this copyright remains--><!--INSTRUCTIONS1. Open Ubot2. Drag in UI HTML node3. Insert this entire document (before or after editing)4. Set Heigth to 2505. Hit OK--><!--variable=\"#textareaexample\" fillwith=\"value\"variable is the name variable you will use in Ubot to use the information from the UI areafillwith 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} Quote Link to post Share on other sites
JackCrow 4 Posted March 27, 2013 Author Report Share Posted March 27, 2013 I HATE that I can't understand this. WTF! I am so pissed! Quote Link to post Share on other sites
JackCrow 4 Posted March 28, 2013 Author Report Share Posted March 28, 2013 Nothing against Ubot. The software is amazing. I just hate how little I know about all of this. I wish I learned it years ago. :-/ Quote Link to post Share on other sites
JackCrow 4 Posted March 28, 2013 Author Report Share Posted March 28, 2013 2 f*ucking days on this. I'll have to re-post to make sure my question is clear. Quote Link to post Share on other sites
darryl561 177 Posted March 28, 2013 Report Share Posted March 28, 2013 2 f*ucking days on this. I'll have to re-post to make sure my question is clear. Answered in your other thread: http://www.ubotstudio.com/forum/index.php?/topic/13420-are-there-any-guidelines-for-idiots-like-me/ 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.