darklonerlv Posted August 4, 2010 Share Posted August 4, 2010 im trying to get this script to repeat itself, im still learning autoit and correct me if i am wrong i believe the @error flag gets stuck once this is detected its a random blinking color i want to find that will appear and disappear. is the Until not @error where my problem lies? How would i get this to repeat itself. after each detection of the correct color Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error send("{UP}",1) Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2010 Share Posted August 4, 2010 You want to repeat something. You know how to use a loop. So what's the problem? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
darklonerlv Posted August 4, 2010 Author Share Posted August 4, 2010 when it locates it the first time, it stops sending the defined key like it the flag is stuck. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2010 Share Posted August 4, 2010 But you coded it to only check one time! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
darklonerlv Posted August 4, 2010 Author Share Posted August 4, 2010 fair enough ill post the entire code 6 times max is what im working with. first one works great then it stops Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error send("{UP}") Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error send("{UP}",1) Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error send("{UP}",1) Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error send("{UP}",1) Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error send("{UP}",1) Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2010 Share Posted August 4, 2010 (edited) Take a look at this: ;script starts Do $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error ;loop until color found send("{UP}",1) ;scripts exits Do you understand what I mean now? So if you want it to repeat, stick it in a loop: ;script starts While 1 ;makes for a good eternal loop Do Sleep(10) $coord = PixelSearch( 588, 422, 599, 434, 16645626, 10 ) Until Not @error ;loop until color found send("{UP}",1) WEnd ;script never comes here Edit: I hope you have a Sleep() in there, you don't want to suck up the whole CPU do you? (added sleep to example) Edited August 4, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
darklonerlv Posted August 4, 2010 Author Share Posted August 4, 2010 lol yea i got ya now. now to add a stop function 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