Jump to content

Help with a loop @error


uber125
 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...