zoephoenix 0 Posted November 5, 2014 Report Share Posted November 5, 2014 (edited) I have so far been able to get my program to scrape a list of items from a table on a website and only return the values of the rows that I need to mouse over. For example, Row 0, Row 1, Row 4, etc, if the value of the content of that row fits my criteria. Now, I need to be able to have it mouse over only those rows in the table on the website; without mousing over them, the button I need clicked will not show. My list contains: 01469101112etc With this, it should hover over row 0, row 1, row 4, row 6, etc. I'm not sure how to go about doing this. The list item itself is the number of the row I need the program to mouse over... how can I do this and have it do it for all items on the list? Help? Edited November 5, 2014 by zoephoenix Quote Link to post Share on other sites
UBotDev 276 Posted November 6, 2014 Report Share Posted November 6, 2014 If there is no way to identify the rows, you can still use "element offset" and I guess you could just pass row number as an offset input. Quote Link to post Share on other sites
zoephoenix 0 Posted November 6, 2014 Author Report Share Posted November 6, 2014 (edited) This is what I did: define clickrows { set(#listposition, $list item(%myuser, $list position(%myuser)), "Global") mouse over($element offset(<class="cell-wrapper screen-name-cell ng-scope">, #listposition), "No") wait(5) increment(#myuserposition) set(#listposition, $next list item(%myuser), "Global") wait(2)} This works as intended; it mouses over only the row numbers in the list. I've only had some light programming experience in the past, so this is all fairly new to me. Any advice on how to stop the program from running completely when a certain condition is met, such as when a variable is a certain value? I'd like to be able to stop the whole program from running with a clickable button, if that's possible. Edit: also, the reason I had to do it this way was that not only does the button that needs to be clicked not pop up until the row is moused over, but the info used to identify the row disappears upon mouse over. So, I had to scrape the data first, search for that identifying text in it, then put the list of list items that had that in it into another list which I used to pull the row numbers from. Edited November 6, 2014 by zoephoenix Quote Link to post Share on other sites
UBotDev 276 Posted November 6, 2014 Report Share Posted November 6, 2014 Any advice on how to stop the program from running completely when a certain condition is met, such as when a variable is a certain value? I'd like to be able to stop the whole program from running with a clickable button, if that's possible. It's fairly simple, just use something like: if(comparison(#variable,"=","certain value")){ stop }. Quote Link to post Share on other sites
zoephoenix 0 Posted November 8, 2014 Author Report Share Posted November 8, 2014 I tried doing something like that, but I can't get it to work. I found this thread with an attachment that looks like the solution to my issue, but I can't seem to download it. It says I don't have permission. http://www.ubotstudio.com/forum/index.php?/topic/14767-an-easier-way-to-stop-script-when-using-the-ui-button/&do=findComment&comment=83501 Quote Link to post Share on other sites
UBotDev 276 Posted November 8, 2014 Report Share Posted November 8, 2014 The code you reference is actually meant for custom UI Start buttons, but the code I proposed still works, here is an example: ui button("STOP") { set(#STOP, $true, "Global") } set(#STOP, $false, "Global") loop while($true) { if(#STOP) { then { stop script } else { } } wait(1) } Any way, if you need custom start button, I was able to download that attachment for you (shared by Gogetta), so here is the code : ui button("Start") { if($comparison(#running, "=", "true")) { then { alert("There is already a process running. ") stop script } else { } } set(#running, "true", "Global") thread { loop while($comparison(#running, "=", "true")) { wait(1) } thread { alert("Done!") } wait(1) stop script } set(#thread_count, 0, "Global") loop(100) { increment(#thread_count) thread { in new browser { nav_to() } decrement(#thread_count) } loop while($comparison(#thread_count, ">=", 3)) { wait(1) } } set(#running, "false", "Global") } ui button("Abort") { set(#running, "false", "Global") } define nav_to { navigate("http://google.com", "Wait") reset account("Any") navigate("http://ubotstudio.com/playground/simple-form", "Wait") type text(<about me textarea>, $account data("First Name"), "Standard") wait(3) } 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.