Jmoore3274 Posted September 6, 2009 Share Posted September 6, 2009 First off before I start I would like to express my absolute asstoundment in the support the Autoit community gives. I have been able to find everything I have needed to make a script as I think it up. This community seriously backs up its code. The only issues I have is with trying to make Pixel Search loop in a mannor I like. Please understand Im a complete noob and I hate asking for help. Below is my code which is simple and easy:$coord = PixelSearch( 779, 172, 802, 192, 0xC11414, 10 )If Not @error Then MouseMove( 797,181 ) Sleep( 500 ) Send( "{CTRLDOWN}" ) MouseClick("Left" ) Sleep( 1000 ) Send( "{CTRLUP}" ) EndIfThis is what I'm trying to accomplish. 1) I would like Autoit to search an area specified for a certin color. If it dosen't find it then it will continue to search every 10 seconds. When it does find the color it will then execute the mouse movements and keystrokes and then loop, looking for the color and executeing everything again every 10 seconds. 2)Once the color is gone it will then reset and keep looking for the color again. 3)If the color isnt found then it will keep looking evey 10 seconds till the color is found. Now I have looked all over the place for a answer or even a hint to direct me in the correct direction. I have found nothing that makes sence to me.If any one can help I would greatly appriciate it. BTW if my spelling and grammar is bad Im sorry. I blame it on the liquor. It has been one of those late nights codeing and drinking Link to comment Share on other sites More sharing options...
Hawkwing Posted September 6, 2009 Share Posted September 6, 2009 (edited) While 1 Sleep(10000) $coord = PixelSearch(779, 172, 802, 192, 0xC11414, 10) If @error = 0 Then ;~ do stuff EndIf WEnd Not sure if I completely understood, but I think this will do what you want. Edit: btw, Welcome to the Forum! Edited September 6, 2009 by Hawkwing The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
Jmoore3274 Posted September 6, 2009 Author Share Posted September 6, 2009 Thanks for the help hawkwing. Looking at your code made me connect palm to face. I can't believe I didn't figure that out on my own. Again thank you for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now