Adergon 0 Posted January 5, 2012 Hey All! I have this function imagesearch here. Do $result = _ImageSearch("picture1.png",1,$x1,$y1,15) If $result= 1 Then MouseClick("Left", $x1, $y1, 1) If $result= 0 Then Sleep(2000) Until $result = 1 This code actually do work, but i would like to change it a little. How edit the function, so it moves on to the next function after X amount on seconds? becuase i don't want it to sit still there and just wait for the image. i want it to move on to the next function if it doesnt find it. reason why i make it wait for the image, is because i want it to click as soon as the picture pops up. THANKU Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 5, 2012 If you want it to get out of that loop if the image is not found, then simply remove the loop. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Adergon 0 Posted January 5, 2012 If you want it to get out of that loop if the image is not found, then simply remove the loop.I'm not so good with AutoIt, could you please post an example? Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 5, 2012 $result = _ImageSearch("picture1.png",1,$x1,$y1,15) If $result= 1 Then MouseClick("Left", $x1, $y1, 1) If $result= 0 Then Sleep(2000) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Adergon 0 Posted January 5, 2012 (edited) $result = _ImageSearch("picture1.png",1,$x1,$y1,15) If $result= 1 Then MouseClick("Left", $x1, $y1, 1) If $result= 0 Then Sleep(2000) Does that function wait for the image? becuase isn't this: Until $result = 1 Needed? EDIT: I want the function to wait for the image for 10 seconds. otherwise it moves on. sorry, was a bit unclear Edited January 5, 2012 by Adergon Share this post Link to post Share on other sites
AdmiralAlkex 125 Posted January 5, 2012 You want a timer. Open helpfile and read about TimerInit() and ExitLoop. .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
Adergon 0 Posted January 5, 2012 You want a timer. Open helpfile and read about TimerInit() and ExitLoop.I read trough it, and i see the idea. i set the timerinit for 10 seconds, and then it exits the function right? but i dont seem to get this work with the imagesearch. could you or someone add it to the code? then it will be easier for me to understand. Since im new to this. Sorry. Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 7, 2012 That's not the way of things here. Post your code, and if someone can help you with it they will. You can just keep asking for someone to do it for you and it might work and it's your time to waste, but if you show your willing and effort, that time will pass much quicker. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites