Sign in to follow this  
Followers 0
uber125

Help with a loop @error

5 posts in this topic

I have a scrips that does a search. some times the search fails. Is there a way to say;

CODE

If @error Then

run check again

EndIf

Thus creating a loop, that will allow the search to be preformed until the desired object is found?

Share this post


Link to post
Share on other sites



I have a scrips that does a search. some times the search fails. Is there a way to say;

CODE

If @error Then

run check again

EndIf

Thus creating a loop, that will allow the search to be preformed until the desired object is found?
Do
   run check again
Until not @error

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Do
   run check again
Until not @error
Ok, it works if I maximise the window after lodes.

However, I'm trying to get it to just log in once it recognizes a certain color pixel.

Hence the loop.

CODE
Run ("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.hotmail.com/")

WinWaitActive("Sign In - Microsoft Internet Explorer")

Sleep (300)

WinMove("Sign In - Microsoft Internet Explorer", "", 0, 0, 1000, 900)

$coord = PixelSearch(152, 497, 152, 497, 0xFF6002, 1)

If Not @error Then

$checksum = PixelChecksum(152, 497, 152, 497)

EndIf

If @error Then

Do

$coord = PixelSearch(152, 497, 152, 497, 0xFF6002, 1)

Until not @error

EndIf

While $checksum = PixelChecksum(152, 497, 152, 497)

Sleep(200)

WEnd

Send ("user@hotmail.com")

Send("{TAB}")

Send ("password")

Send("{ENTER}")

Any Ideas? Edited by uber125

Share this post


Link to post
Share on other sites

Why not just use the _IE.au3 functions?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Why not just use the _IE.au3 functions?

because that would make sense... :">

lol thanks I didn't see them in there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0