Jump to content
UBot Underground

$Loop While Does Not Run Given Commands When True.


Recommended Posts

So my end goal is to make it visit http://whatismyip.com/ and if it can't get to the webpage, the proxy needs to be changed with a loop while that looks for a specific text given by the browser that $exists.

 

When I set it to that text, and that text is on the web page, it skips the rest of the loop and goes on. I don't think my words are making very much sense, so here is a picture to describe what I mean:

 

http://puu.sh/iDbke/546f1bd4e2.jpg

 

I intentionally placed a fake proxy for the first line so I can combat the issue.

 

 

 

Post #7 contains my solution.

Edited by Ingram Assets
Link to post
Share on other sites

May i suggest you just let us see the code maybe we can help!

 

I cant help you like this but i suspect your issue is quite simple you probably placed the wrong if statement 

 

If Text Exists 

Than Start $Loop While

Else Continue with the script

 

So Problem is Somewhere in your IF Statement!

 

Problem Could be with Timing of it all (I Noticed you use Wait Command instead of "Wait for element")

 

 

So if you could post your code we could help you!

Link to post
Share on other sites

In your image you show that the loop while is based on something existing - So, as soon as it does not find what it is looking for, the loop while ends.

 

So if I understand your code correctly - the moment your script hits a good proxy, the loop-while process ends.

 

So as long as all of that code is nested inside of a loop, it should be fine.

 

You might want to look around the forum a bit - there are people who have posted complete source code for proxy checkers.

Link to post
Share on other sites

May i suggest you just let us see the code maybe we can help!

 

I cant help you like this but i suspect your issue is quite simple you probably placed the wrong if statement 

 

If Text Exists 

Than Start $Loop While

Else Continue with the script

 

So Problem is Somewhere in your IF Statement!

 

Problem Could be with Timing of it all (I Noticed you use Wait Command instead of "Wait for element")

 

 

So if you could post your code we could help you!

 

 

if($exists(<innertext="Could not create a connection to the proxy server.">)) {
    then {
        loop while($exists(<innertext="Could not create a connection to the proxy server.">)) {
            alert("Changing Proxy")
            increment(#proxyposition)
            change proxy($list item(%proxy,#proxyposition))
            navigate("http://whatismyip.com/","Wait")
            wait(5)
        }
    }
    else {
    }
}

That is my code for the entire if statement containing the loop.

Link to post
Share on other sites

In your image you show that the loop while is based on something existing - So, as soon as it does not find what it is looking for, the loop while ends.

 

So if I understand your code correctly - the moment your script hits a good proxy, the loop-while process ends.

 

So as long as all of that code is nested inside of a loop, it should be fine.

 

You might want to look around the forum a bit - there are people who have posted complete source code for proxy checkers.

 

Yeah, I have searched a bit, my problem is getting the code to loop again when the proxy is bad. I compared mine to others, and its very similar, so I don't see what I am doing incorrectly.

Link to post
Share on other sites

I guess I have got it to work with the following code:

 

loop while($exists(<innertext="Could not create a connection to the proxy server.">)) {
    increment(#proxyposition)
    change proxy($list item(%proxy,#proxyposition))
    navigate("http://whatismyip.com/","Wait")
    wait for browser event("Everything Loaded","")
}
Link to post
Share on other sites

Ingram - that code means that when it hits a good proxy it will stop running the loop-while loop.

 

As long as you have the loop-while nested inside of a loop then you'll be good to go.

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