mrwalt 34 Posted October 16, 2013 Report Share Posted October 16, 2013 Hi Carl, I was curious as I have seen a lot of "Start", "Stop", and "Pause" codes for running custom UI Panels on this forum. In your experience what code has worked best for you when using your UI Builder to build bots for custom Start, Stop, and Pause UI buttons. Thus far this (http://www.ubotstudio.com/forum/index.php?/topic/12766-how-does-pause-script-and-stop-script-work/) appears to be one of the more simpler codes but it seems like it could run into a problem if someone hits the Start button more than once as you could have multiple scripts running over each other at the same time.Do you know of a better Start, Stop, and Pause code that would work better with your UI Builder? mrwalt Quote Link to post Share on other sites
LazyBotter 188 Posted October 16, 2013 Author Report Share Posted October 16, 2013 Adding a pause button is possible but it is not great, the pause script is meant for debugging. I have made a little script to try and explain to you/others the best way to setup a start/stop button. (Will work for multi-threading too). Here is the code: comment("This is the best way to setup your script to stop. (Especially When Multi-Threading)") ui html panel("<!DOCTYPE html> <html lang=\"en\"> <head> <title></title> </head> <body> <input type=\"button\" onclick=\"ubot.runScript(\'Start()\')\" value=\"Start\" /> <input type=\"button\" onclick=\"ubot.runScript(\'Stop()\')\" value=\"Stop\" /> <br> <span variable=\"#Stat\" fillwith=\"innertext\"></span> </body> </html>", 100) define Start { comment("Check to see if the script is aleady running...") if($comparison(#Stop, "=", $false)) { then { alert("Script Already Running!!") } else { comment("If NOT running set the #Stop var back to $false and run the Main Script.") alert("Script is going to run. Try to click the Start Button again!!") set(#Stop, $false, "Global") Main Script() } } } define Stop { set(#Stop, $true, "Global") } divider comment("Check to see if #Stop is set to $true and if so stop the script") define Check Stop { if($comparison(#Stop, "=", $true)) { then { set(#Stat, "Stopped!", "Global") stop script } else { } } } divider define Main Script { set(#Loop_Pos, 0, "Global") loop(100) { set(#Stat, "Loop Pos: {#Loop_Pos}", "Global") increment(#Loop_Pos) wait(1) comment("Here is the \"Check Stop\" define to run after every navgate command etc") Check Stop() } } Hope that helps! Carl Quote Link to post Share on other sites
mrwalt 34 Posted October 16, 2013 Report Share Posted October 16, 2013 Hi Carl, Thank you again for posting this as it does help a lot. mrwalt Quote Link to post Share on other sites
Bot-Factory 602 Posted October 22, 2013 Report Share Posted October 22, 2013 Hello. From time to time I have the problem, that delete and movements don't work in the HTML forms. That happens in the builder, as well as in the html UI within Ubot Studio. I can still type and use the mouse. It doesn't happen all the time and I don't know the reasons for it. Has someone else experienced that as well? Dan Quote Link to post Share on other sites
LazyBotter 188 Posted October 23, 2013 Author Report Share Posted October 23, 2013 Hi, V3.3 Update I have fixed the issue with the elements becoming not draggable, (this was because of the scroll box messing things up. FIXED NOW). I have added a new element "Dynamic Drop Down". You can now populate the drop down menu dynamically! Instructions: Create your element by adding two #Variables, one for the #Selection and one for your #Options. and to populate set the #Options variable to the options you wish to add to the drop down. (Comma Delimited). set(#Options, "1,2,3,4,5,6,7,8,9,0", "Global") Carl Quote Link to post Share on other sites
don 1 Posted October 23, 2013 Report Share Posted October 23, 2013 Hi Carl, Fantastic piece of software (Y) Any plans to add a off / on button and a slider to turn on and off things? Thanks Quote Link to post Share on other sites
botoballs 2 Posted October 24, 2013 Report Share Posted October 24, 2013 Does this work with Standard and Professional version? Quote Link to post Share on other sites
LazyBotter 188 Posted October 24, 2013 Author Report Share Posted October 24, 2013 Does this work with Standard and Professional version? No sorry only the developer edition. Hi Carl, Fantastic piece of software (Y) Any plans to add a off / on button and a slider to turn on and off things? Thanks Thanks! Im glad you like it! I will try and get hidden elements added as a feature! Quote Link to post Share on other sites
darryl561 177 Posted October 25, 2013 Report Share Posted October 25, 2013 removed Quote Link to post Share on other sites
mrwalt 34 Posted October 26, 2013 Report Share Posted October 26, 2013 Hi Carl, In the above example if for some reason you did implement a Pause command into your bot along with the Start and Stop commands how would you do it to make it work as effective as possible? Thank you for your help, mrwalt Quote Link to post Share on other sites
LazyBotter 188 Posted October 27, 2013 Author Report Share Posted October 27, 2013 Hi Carl, In the above example if for some reason you did implement a Pause command into your bot along with the Start and Stop commands how would you do it to make it work as effective as possible? Thank you for your help, mrwalt Do you mean something like this? ui stat monitor("Count:", #Count) ui button("Start Script") { if($comparison(#Pause, "=", $true)) { then { set(#Pause, $false, "Global") } else if($comparison(#Stop, "=", $false)) { alert("Script Already Running!!") } else { comment("If NOT running set the #Stop var back to $false and run the Main Script.") alert("Script is going to run. Try to click the Start Button again!!") set(#Stop, $false, "Global") set(#Pause, $false, "Global") Script() } } } ui button("Stop Script") { set(#Stop, $true, "Global") } ui button("Pause / Play") { if($comparison(#Pause, "=", $true)) { then { set(#Pause, $false, "Global") } else { set(#Pause, $true, "Global") } } } define Check Pause { loop while($comparison(#Pause, "=", $true)) { wait(2) } } define Check Stop { if($comparison(#Stop, "=", $true)) { then { stop script } else { } } } define Check Status { Check Stop() Check Pause() } define Script { set(#Count, 0, "Global") loop while(1 = 1) { increment(#Count) wait(1) Check Status() } } Carl Quote Link to post Share on other sites
mrwalt 34 Posted October 30, 2013 Report Share Posted October 30, 2013 Thank you for this example, but i think that you are correct the first time when you said that it would be best to stick with a Start and Stop command only after looking at the code. Thanks, mrwalt Quote Link to post Share on other sites
Bliss 194 Posted October 31, 2013 Report Share Posted October 31, 2013 Hi Carl, is your licensing server down? it was working fine yesterday, seems like its down now? Excellent software by the way, love it! I would of never of thought i would be using a ui builder as i was designing my UI's in MS Expressions and DW... but this is so fast, clean and easy i would be stupid not to use it. Jane Quote Link to post Share on other sites
LazyBotter 188 Posted October 31, 2013 Author Report Share Posted October 31, 2013 Its fine here? I can login to my admin ok? Glad you like my software! Quote Link to post Share on other sites
Steve 30 Posted October 31, 2013 Report Share Posted October 31, 2013 Hey Carl -- I think I might buy this today to add it to my toolbox, to speed things up a bit Quote Link to post Share on other sites
Bliss 194 Posted October 31, 2013 Report Share Posted October 31, 2013 Its fine here? I can login to my admin ok? Glad you like my software! yup its working today again.. strange Quote Link to post Share on other sites
Steve 30 Posted October 31, 2013 Report Share Posted October 31, 2013 So I bought this today as I said I would earlier, and so far really it is a great tool! There's only a few things that I could think that would make this near perfect -- one of which would be allowing you to click on an element after you have already added it and have the ability to update the properties of the element (without having to delete and add a new element and all the properties over again). Same thing with importing html ui, it would be cool if it updated the "user interface styling" section with the original settings so they can be modified if needed without having to re-enter everything. Few other little things, but either way... this program def. helps save time and was worth the purchase for me. I do have a question though (not specifically about your program), but do you know if there is any way of having the bot interact with the UI through jquery or anything? For example, let's say I want to hide one of the UI buttons during a specific section of my script, is there a way to do something like: run javascript("$( \".btn\" ).hide();") Quote Link to post Share on other sites
LazyBotter 188 Posted October 31, 2013 Author Report Share Posted October 31, 2013 Thanks for your purchase and suggestions, I have taken them onboard and will try to get them added. Quote Link to post Share on other sites
LazyBotter 188 Posted November 5, 2013 Author Report Share Posted November 5, 2013 V3.4 Update! You can now load the element properties for easy editing! NOTE!! If you try to import a UI created with older versions than V3.4, some properties may not load. But all newly created UI's will work fine! Quick Overview Video. http://youtu.be/SqSNeinaG0U Carl Quote Link to post Share on other sites
rocket976 62 Posted November 5, 2013 Report Share Posted November 5, 2013 Nice job just keeps getting better! Quote Link to post Share on other sites
LazyBotter 188 Posted November 5, 2013 Author Report Share Posted November 5, 2013 Nice job just keeps getting better! Thanks glad you like it!! Quote Link to post Share on other sites
don 1 Posted November 5, 2013 Report Share Posted November 5, 2013 Cool, keep up the good work (Y) I need to ask you if there is any way i could add checkboxes inside a dropbox to have multiple selection as a listbox? Quote Link to post Share on other sites
Steve 30 Posted November 5, 2013 Report Share Posted November 5, 2013 Nice! That's basically what I was asking for Thanks! Quote Link to post Share on other sites
LazyBotter 188 Posted November 6, 2013 Author Report Share Posted November 6, 2013 Cool, keep up the good work (Y) I need to ask you if there is any way i could add checkboxes inside a dropbox to have multiple selection as a listbox? Yes you can already do this, you need to create a "Scroll Box" and give it some ID like "Scroll Box 1". Then when you add your checkboxes you can add them to the "Scroll Box 1" which will be available in the drop down menu. Quote Link to post Share on other sites
don 1 Posted November 6, 2013 Report Share Posted November 6, 2013 Yes you can already do this, you need to create a "Scroll Box" and give it some ID like "Scroll Box 1". Then when you add your checkboxes you can add them to the "Scroll Box 1" which will be available in the drop down menu. I don't understand it, how would a scrollbox appear in a dropdown menu? 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.