#include #include #include #include ; Required for _ArrayDisplay. ; ----------------------- # UDF checkForImage Method # ----------------------- MsgBox(0,"","Script Execution Started", 2) Global $x = 0, $y = 0 Global $sImgPath = "D:\Autoit Practice files\Quality_policy.png" Do Sleep(300) Until _FindImage($sImgPath) MouseMove($x,$y,5) Sleep(3000) MouseClick($MOUSE_CLICK_LEFT, 2) Func _FindImage($sImgPath);Initialize and prepare ImageSearch. _GDIPlus_Startup();Initialize Microsoft Windows GDI+. Local $hImage = _GDIPlus_ImageLoadFromFile($sImgPath);Create an image object based on a file. ; Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage);Create a handle to a bitmap from a bitmap object. Send("#d") Sleep(2000) ;Search for Image. $iRet = _ImageSearch($sImgPath, 1, $x, $y, 0) ; Default=5: Tolerance, if it does not work for you rise it (up to 255) ;Begin Cleanup. ; _WinAPI_DeleteObject($hHBmp);Deletes a logical pen, brush, font, bitmap, region, or palette. _GDIPlus_ImageDispose($hImage);Release an image object. _GDIPlus_Shutdown();Clean up resources used by Microsoft Windows GDI+. MsgBox(0, "$iRet", "$iRet : " & $iRet,2) if $iRet=1 Then MsgBox(0, "Example", "Found Image!" & @CRLF & @CRLF & "Coord X = " & $x & "." & @CRLF & "Coord y = " & $y & ".", 2) EndIf ;Report Result. Return $iRet;Will return 1 if image was found. If no image was found, this will return 0. EndFunc