Adergon Posted January 5, 2012 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
JohnOne Posted January 5, 2012 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.
Adergon Posted January 5, 2012 Author 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?
JohnOne Posted January 5, 2012 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.
Adergon Posted January 5, 2012 Author 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
AdmiralAlkex Posted January 5, 2012 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
Adergon Posted January 5, 2012 Author 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.
JohnOne Posted January 7, 2012 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.
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