Jump to content
UBot Underground

Help With Loops


Recommended Posts

hey so im making a comment bot it uses proxies so if you load a dead proxy i want it to skip it. So what i have does is 

 

Loop (proxy list total)

Set variable #proxy

Change proxy #proxy

nav google

If exists 

then run bot 

if it doesnt exists 

do nothing

 

What i want to do is have it keep changing the proxy over and over till it google loads then run the bot once and then go back to checking proxies.

 

But i want a variable to set how many times to run the bot. if i set the loop total to 10 it will just run 10 failed proxies and be done.

 

I want the loop total to proxy list total but only run the bot 10 times. how could this be done?

 

 

 

Link to post
Share on other sites

Here you go

ui open file("Proxy file", #proxy file)
ui text box("Loops", #loops)
clear list(%proxys)
add list to list(%proxys, $list from file(#proxy file), "Delete", "Global")
set list position(%proxys, 0)
set(#worked, 0, "Global")
loop while($comparison(#worked, "<", #loops)) {
    if($comparison($list total(%proxys), "<=", 0)) {
        then {
            alert("Ran out of working proxys")
            stop script
        }
        else {
        }
    }
    set(#proxy, $next list item(%proxys), "Global")
    change proxy(#proxy)
    navigate("https://www.google.com/?gws_rd=ssl", "Wait")
    if($exists(<name="q">)) {
        then {
            increment(#worked)
        }
        else {
            remove from list(%proxys, $list position(%proxys))
        }
    }
}

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