Rapid Posted October 3, 2015 Share Posted October 3, 2015 (edited) hello, i've tried to use _waitforimage using the imagesearch library, but it doesn't seem to work properly for me.Basically, after a function being done, I want to wait for a button to appear, and when it appears it will proceed.;=============================================================================== ; ; Description: Wait for a specified number of seconds for an image to appear ; ; Syntax: _WaitForImageSearch, _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition, ByRef $x, ByRef $y,$tolerance,$HBMP=0) I tried using it like that - $temp = _WaitForImageSearch($FindImage,10,1, $tempx, $tempy,0) it didn't seem to work...if I stated 10secs to wait, does it mean during the 10sec it will search for the image till it appears and then stop? or it waits 10sec and then give it another try?thanks I added the ImageSearch files i'm using(I use PNG's btw, and it works fine with _ImageSearch)ImageSearch.au3ImageSearchDLL.dll Edited October 3, 2015 by Rapid Link to comment Share on other sites More sharing options...
Danyfirex Posted October 3, 2015 Share Posted October 3, 2015 During the seconds you pass it will check every 100 miliseconds for the image till 10 secound ends. Reagrds. Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Rapid Posted October 3, 2015 Author Share Posted October 3, 2015 But am I doing it right with my code? Is it the right way? Link to comment Share on other sites More sharing options...
AutoBert Posted October 3, 2015 Share Posted October 3, 2015 (edited) It's the right way. _WaitForImageSearch searches the image until found or timeout. When found your $Temp = 1, in $TempX and $TempY are the coordinates of the Image. Edited October 3, 2015 by AutoBert Link to comment Share on other sites More sharing options...
Rapid Posted October 3, 2015 Author Share Posted October 3, 2015 Thank AutoBert and Danyfirex 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