darklonerlv 0 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) Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites
darklonerlv 0 Posted August 4, 2010 when it locates it the first time, it stops sending the defined key like it the flag is stuck. Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites
darklonerlv 0 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) Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites
darklonerlv 0 Posted August 4, 2010 lol yea i got ya now. now to add a stop function Share this post Link to post Share on other sites