Jump to content
UBot Underground

help with scrolling through a list


Recommended Posts

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:

 

0

1

4

6

9

10

11

12

etc

 

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 by zoephoenix
Link to post
Share on other sites

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 by zoephoenix
Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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

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