Leaderboard
Popular Content
Showing content with the highest reputation on 09/12/2015 in all areas
-
Thx for the link and anyway for all your replies, trancexx. The basic reasons that I saw you explaining there, seem to be: "Using dllstructs that way goes directly against the typing paradigm of the language. On top of that dllstruct is not safe type because data is also accessible through pointer." Honestly I don't understand the dangers in either. But that may be because I am only a bad hobby programmer. I mean - no harm meant - who cares about typing paradigms or "safeness of type regarding accessibility through pointer", unless it could be accessed through pointer accidently and then make me loose data or even worse cause my windows system to crash and loose the current windows session (blue screen & loss of currently not saved data). If that is not the case, I don't know what should be "unsafe" about it? What I wonder about is, maybe you and your colleagues speak heavily against its widespread usage, because otherwise it would spread throughout scripts on the net and be a bother to stumble upon / work with and maybe cause uncontrollable side effects like in Terminator, or so. ;-) If this is the case, then just say so and I would understand. Thanks again for your help, in any case. Regards, Stephan2 points
-
ImageSearch Usage Explanation
HansHenrik reacted to Centrally for a topic
After having lot of issues myself with getting ImageSearch to work I decided to make topic with explanation how to proper use this script. Here is link of original topic at this topic: Credits to kangkeng for creating such useful piece of code. What is ImageSearch? It's script that find part of screen which you before defined with given image. When should I use ImageSearch? You should use it whenever it's not possible or unlikely that pixelsearch will give what you need. So how can I use ImageSearch and enjoy it's awesome benefits? First of all to avoid mostly caused problems I recompiled DLLs for both architectures which you can download at end of this post. When you pick your package you should place both ImageSearch.au3 and ImageSearch.dll inside script folder. Usage Example: First of all take picture of what you want to search for (print screen + paint + corp + save as bmp). Place that picture in script directory (I named my picture checkImage (checkImage.bmp is full name with extension). You must include ImageSearch.au3 in your script. ImageSearch.au3 consist of 2 Functions you can use: _ImageSearch and _ImageSearchArea Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify a desktop region to search Values to put in for _ImageSearch function (entire screen search) ($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance, $HBMP=0) Values to put in for _ImageSearchArea function (you declare part of screen to be searched) ($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance,$HBMP=0) Description of parameters from ImageSearch.au3 itself: ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $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 Example of my script using _ImageSearch ( entire screen search) #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() Local $search = _ImageSearch('checkImage.bmp', 0, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd Example of my script using _ImageSearchArea #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() local $search = _ImageSearchArea('check5.bmp', 1, 800, 40, 900, 80, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd I would like to apologize if by writing this I offended any of member that thinks this script is too simple to even have it explained, it's just as me being new to autoIt it took me so much time getting around errors and making this script to work. Thanks for reading, if you bump on any problems using it post it here, I will try to help you fixing it and update topic for further reference. Download links: 32bit: ImageSearch 32bit.rar 64bit: ImageSearch 64 bit.rar1 point -
Hi Folks, I'm a great fan of AutoIT. While trying to automate data entry into a java applet based ERP, I found that checking for entry error or success is quite a pain using pixelsearch. Instead, check for a data entry "success" or "failed" image is far simpler. This a feature found in AHK, I've cut out the necessary code and compiled it into a DLL, and written a au3 library around it. I've tested it in various XP and W2k3 machines, and it seems to work fine. It's a quick and dirty hack I did to get a job done, so your mileage may vary ImageSearch.zip (84K) Number of downloads:1 point
-
Concerning the discussion in this thread. I'm curious why some people deem using DllStructs for anything other than arguments for DllCall, wrong. If there is some technical reason why it's wrong or foolish or something I sure would like to hear it. In that thread it's mentioned that an ex code dev (probably valik) who was well clued up said it's wrong, and also trancexx who is also clued up and also ex dev mentioned it being a "no no". One thread is linked but no explanation is given, I'd be mighty obliged if anyone has the link to the other discussion. I'd like to point out also that DllStructs are used other than in DllCalls inside some standard UDF's,1 point
-
Excellent. You nailed it. ...Go away now, I'm starting to like you. Shoo!1 point
-
and without regexp. This is provided this string doesnt have a bunch of bonus pipe characters thrown in. $sString = "|A&| & |B#| & |*C| & |%5|" $i = 1 $sMax = stringinstr($sString , "|" , 0 , -1) Do $sFirst = Stringinstr($sString, "|" , 0 , $i) $i += 1 $sSecond = Stringinstr($sString, "|" , 0 , $i) $i += 1 $sString = stringreplace($sString , stringmid($sString , $sFirst + 1 , $sSecond - $sFirst - 1) , "Alex") Until $sSecond >= $sMax msgbox(0, '' , $sString)1 point
-
or this (last attempt for me) : $sString = "|A| & |B| & |C| & |5|" $sNewString = StringRegExpReplace($sString, "(?<=\|)\h*[^|&]+\h*(?=\|)", "Alex") ConsoleWrite($sNewString & @CRLF)1 point
-
Alex1986, Stop changing the goalposts as the thread progresses! How about this: $sString = "|A&| & |B#| & |*C| & |%5|" $sReplace = "Alex" $sNewString = StringRegExpReplace($sString, "(?U)(^|\s)\|.+\|(\s|$)", " |" & $sReplace & "| ") ConsoleWrite($sNewString & @CRLF)M231 point
-
I will ignore you previous sarcastic comment and answer this one. Why should I explain when it's obvious? It's like asking me to explain why a hammer shouldn't be used as a saw.1 point
-
Celtic88, Thanks for posting, but given the content of the other thread by this member I do not think he deserves that much help. M231 point
-
1 point
-
@Celtic88. As I said. AutoIt does not support that. I meant that you can use structure to simulate a C variable. so the answer to autocart's asking is not. Saludos1 point
-
How to get the address to a variable?
matwachich reacted to Celtic88 for a topic
yes you can Local $Structinfo = "char Name[25];int Age;char Country[25];Ptr AddressMemory" Dim $ArryPerson[20] For $i = 0 To 19 $ArryPerson[$i] = DllStructCreate($Structinfo) DllStructSetData($ArryPerson[$i], "Name", "Mohamed " & $i) DllStructSetData($ArryPerson[$i], "Age", Random(15, 22, 1)) DllStructSetData($ArryPerson[$i], "Country", "ALGERIA ") Next Local $temp = "" For $i = 0 To 19 $temp &= DllStructGetData($ArryPerson[$i], "Name") & " " & DllStructGetPtr($ArryPerson[$i], "Name") & " " $temp &= DllStructGetData($ArryPerson[$i], "Age") & " " & DllStructGetPtr($ArryPerson[$i], "Age") & " " $temp &= DllStructGetData($ArryPerson[$i], "Country") & " " & DllStructGetPtr($ArryPerson[$i], "Country") & " " & @CRLF Next MsgBox(0, 0, $temp)1 point -
Ihab_InjeCtor, Please read the Forum rules before posting again - and if you ever post anything like this again you will be removed from the community immediately. M231 point
-
Doesnt _DateTimeFormat() give the requested result? jos1 point
-
So this should be better documented in HelpFile . I will do a track ticket but before must change the example of ObjEvent. Thanks. mLipok1 point
-
1 point
-
I added this code in _imageSearchArea Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance, $HBMP = 0) ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage If IsString($findImage) Then $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage, "ptr", $HBMP) $err = @error Else $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "ptr", $findImage, "ptr", $HBMP) $err = @error EndIf Switch $err Case 1 ConsoleWriteError("unable to use the DLL file" & @CRLF) exit 1 Case 2 ConsoleWriteError('unknown "return type" ' & @CRLF) exit 1 Case 3 ConsoleWriteError('"ImageSearch" not found in DLL' & @CRLF) exit 1 Case 4 ConsoleWriteError('bad number of parameters' & @CRLF) exit 1 Case 5 ConsoleWriteError('bad parameter' & @CRLF) exit 1 EndSwitch ; If error exit If $result[0] = "0" Then Return 0 ; Otherwise get the x,y location of the match and the size of the image to ; compute the centre of search $array = StringSplit($result[0], "|") $x = Int(Number($array[2])) $y = Int(Number($array[3])) If $resultPosition = 1 Then $x = $x + Int(Number($array[4]) / 2) $y = $y + Int(Number($array[5]) / 2) EndIf Return 1 EndFunc ;==>_ImageSearchArea I down loaded the 64 bit version, and I get the "unable to use the DLL file" error. I thought this might help some to debug. I don't have it working, but I'll try the 32 bit version even though I'm running 64 bit windows 7.1 point
-
Hello and thank you for the tutorial. I have been trying to get this imagesearch function to work for weeks! I took your code and copied it exactly. Then I took ImageSearch.au3, imagesearchdll.dll and my script (Which is a new script file with your code) along with my checkImage.bmp and put them all into my working directory folder. I click the script, I click P and nothing happens but the script no longer runs. I get no error or anything. Did I miss something?1 point
-
i used the 32 bit too same result.1 point
-
Hi i did what u said but i am unable to use the imagesearch function. I used the 64 bit one but now working.1 point
-
ImageSearch Usage Explanation
kcvinu reacted to TimCunningham for a topic
I was having trouble like you were having trouble. This topic is very helpful. I was working on this image search for hours and hours and I could not get it to work! I was able to find the droid I was looking for (heh) when I saved the image as a 24-bit BMP rather than 256 or 16-bit. Not sure why this is but I hope that helps someone. If it isn't working for you, try saving the picture as a different bmp file.1 point -
I'm not really sure about difference because I only compiled last source code I found, if you really want to find out what is different than try finding source code from 2008 and compare it to one from 2010.1 point
-
It is typo, and I got no idea how that line ended there, anyway thanks for pointing it out, I fixed it now.1 point
-
Hello, i think that there's a typo on your "Example of my script using _ImageSearchArea". With this line : local $search = _ImageSearchArea('check5.bmp', 1, 800, 40, 900, 80, $x, $y, 0)Local $search = _ImageSearch('checkImage.bmp', 0, $x, $y, 0)1 point
-
ImageSearch Usage Explanation
TinyCoopMan reacted to kjensen for a topic
I think it's fine. I appreciate that I can use that now instead of merging Auto Hot Key/AutoIT type features. I look forward to re-writing some of my mcros to incorporate this and thank you again for the intro into Image search1 point -
1 point
-
ImageSearch Usage Explanation
kcvinu reacted to VelvetElvis for a topic
<Bump> Anyone know the difference in these .dll's?1 point -
ImageSearch Usage Explanation
knuxfighter reacted to ileandros for a topic
Usually imagesearch library is used for game automatation. Pixel search as well. FF udf it's much more powerful I find. But none of them are trustable 100%1 point -
This is the best thing I've ever seen on the internet. Thanks for this!1 point
-
Hi, nice project! And my first question on this forum. There are some identical images on the screen. _ImageSearchArea returns the coordinates of 1st image it recognizes. Is it possible to get array with all the coordinates of identical images (without dll recompiling if possible ^) )?1 point
-
Fixed my issue with Win7 64bit. Thx alot. it works now!1 point
-
#include-once ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Image Search ; Require that the ImageSearchDLL.dll be loadable ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $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 ; $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ; the color to be used as transparency; can be omitted if ; not needed ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify ; a desktop region to search ; ;=============================================================================== Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0) return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$transparency) EndFunc Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance, $transparency=0) ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if not ($transparency = 0) then $findImage = "*" & $transparency & " " & $findImage if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage) ; If error exit if $result[0]="0" then return 0 ; Otherwise get the x,y location of the match and the size of the image to ; compute the centre of search $array = StringSplit($result[0],"|") $x=Int(Number($array[2])) $y=Int(Number($array[3])) if $resultPosition=1 then $x=$x + Int(Number($array[4])/2) $y=$y + Int(Number($array[5])/2) endif return 1 EndFunc ;=============================================================================== ; ; 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 ; $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ; the color to be used as transparency can be omitted if ; not needed ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs sleep(100) $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance,$transparency) if $result > 0 Then return 1 EndIf WEnd return 0 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for any of a set of ; images to appear ; ; Syntax: _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the ARRAY of images to locate on the desktop ; - ARRAY[0] is set to the number of images to loop through ; ARRAY[1] is the first image ; $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 ; $transparent - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ; the color to be used as transparent; can be omitted if ; not needed ; ; Return Value(s): On Success - Returns the index of the successful find ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs for $i = 1 to $findImage[0] sleep(100) $result=_ImageSearch($findImage[$i],$resultPosition,$x, $y,$tolerance,$transparency) if $result > 0 Then return $i EndIf Next WEnd return 0 EndFunc ; find recycle bin if it is in the top left corner of screen ; change 2nd argument to 0 to return the top left coord instead $result = _ImageSearchArea("recycle.bmp",1,0,0,200,200,$x1,$y1,0,0x000000) ;perfect black used as transparency if $result=1 Then MouseMove($x1,$y1,3) MsgBox(0,"Found","Found a recycle bin with stuff in top left corner") EndIf line: $result = _ImageSearchArea("recycle.bmp",1,0,0,200,200,$x1,$y1,0,0x000000) ;perfect black used as transparency why it not found "recycle.bmp" (this bmp file have some transparency 0x000000) someone tell me about transparency parameter? recycle.bmp1 point
-
Image Search Library
kcvinu reacted to comeonyoureds for a topic
Hey, there! First I wanna thank you for porting this function into a dll for usage in AutoIT. Secondly, I want to ask if it would be possible to make it support the transparency option.Working with objects that don't fit well in a rectangle I think that would be a really nice feature! From what I understand, the code placed here to support transparency can treat things on the screen as being transparent.I was looking for something that treats part of the image in the file as being transparent. Or maybe I'm just confused1 point -
Can anyone tell me if this is working for them on Vista? I cannot get it to work at all. Of course the demo script doesn't work because of Vista's changed icons, but even replacing the included sample images with my own, the function returns a 0 every time.1 point
-
Thanks for the library, it's way faster than the same thing in EXE format I was using up until now. The exe managed to do 14 images * 10 possibilities in ~75 seconds, the dll one can do the same in 29 seconds. One important thing (well, at least for me) however is missing from your Autoit code: a specification for a color that can be defined to work as a transparent. This allows for example to search for words, letters or symbols which are displayed over changing backgrounds. The changed functions: #include-once ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Image Search ; Require that the ImageSearchDLL.dll be loadable ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $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 ; $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ; the color to be used as transparency; can be omitted if ; not needed ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify ; a desktop region to search ; ;=============================================================================== Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0) return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$transparency) EndFunc Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance, $transparency=0) ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if not ($transparency = 0) then $findImage = "*" & $transparency & " " & $findImage if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage) ; If error exit if $result[0]="0" then return 0 ; Otherwise get the x,y location of the match and the size of the image to ; compute the centre of search $array = StringSplit($result[0],"|") $x=Int(Number($array[2])) $y=Int(Number($array[3])) if $resultPosition=1 then $x=$x + Int(Number($array[4])/2) $y=$y + Int(Number($array[5])/2) endif return 1 EndFunc ;=============================================================================== ; ; 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 ; $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ; the color to be used as transparency can be omitted if ; not needed ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs sleep(100) $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance,$transparency) if $result > 0 Then return 1 EndIf WEnd return 0 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for any of a set of ; images to appear ; ; Syntax: _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the ARRAY of images to locate on the desktop ; - ARRAY[0] is set to the number of images to loop through ; ARRAY[1] is the first image ; $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 ; $transparent - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ; the color to be used as transparent; can be omitted if ; not needed ; ; Return Value(s): On Success - Returns the index of the successful find ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs for $i = 1 to $findImage[0] sleep(100) $result=_ImageSearch($findImage[$i],$resultPosition,$x, $y,$tolerance,$transparency) if $result > 0 Then return $i EndIf Next WEnd return 0 EndFuncoÝ÷ ÙìZ^r^jëh×6; find recycle bin if it is in the top left corner of screen ; change 2nd argument to 0 to return the top left coord instead $result = _ImageSearchArea("recycle.bmp",1,0,0,200,200,$x1,$y1,0,0x000000) ;perfect black used as transparency if $result=1 Then MouseMove($x1,$y1,3) MsgBox(0,"Found","Found a recycle bin with stuff in top left corner") EndIf This is pieced together to maintain compatibility with my old Imagesearch approach, but works nonetheless Since this is for games I partially automate, it explains the >for< loop. In games, the HUD (target markers, status bars, ...) have a tendency to blink off and on again so quickly the human eye doesn't notice, but a script surely would. So when an object I'm looking for isn't there, I need to be sure it's not because of a blinking HUD. Ati hardware seems to be more stable than Nvidia on this issue, generating way less HUD blinks, but it's still far from perfect. Tested with Ati x1800 & Nvidia 8800GTS G92 hardware and confirmed by numerous other users. Edit @ ygm Everything your screen shows is "the desktop", be it windows like Firefox or games. Only exclusion, maybe, is video overlays. Haven't yet tested it with those.1 point
-
How to use this on a windows? So not on the desktop, but in the windows file browser or something like that.1 point
-
It would be absolutelly awesome to have new optional parameter hWnd as it is in AutoIt's PixelSearch in latest 3.2.12 version. In this case search would be done only inside given window/control (and not on whole desktop.). This way you could search for image also on hidden/minimized/non active windows. and search could be narrowed on desired control so it will be much faster. I need such functionality in my current project. This could be very simple to implement: Just use GetDC($hWnd) instead of GetDC(0)1 point
-
Image Search Library
kcvinu reacted to bf2forlife for a topic
How this _ImageSearchArea works? $x1=143 $y1=200 _ImageSearchArea("lol.bmp",1,0,0,473,33,$x1,$y1,0) I wanna search image in area size of 473,33 pixels and is in position 143, 200. But it doesnt work. So whats the problem? EDIT: Fixed some of the code but still dont work1 point -
1 point
-
It was a example, but can you help me???1 point
-
Image Search Library
kcvinu reacted to Kickassjoe for a topic
When I first started using AutoIt, this is the type of thing I was looking for, looks nice1 point -
hey kangkenq, this is super awesome very nice work. keep it up1 point
-
I have a problem. my codes will not work. #include <ImageSearch.au3> $x1=0 $y1=0 HotKeySet( "+s", "Start" ) HotKeySet( "+e", "end" ) While 1 Sleep (100) WEnd Func Start() While 1 $result = _ImageSearch("recycle2.bmp",1,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MsgBox(0,"Found","Found a empty recycle bin here...") EndIf WEnd EndFunc Func End() Exit EndFunc and #include <ImageSearch.au3> $x1=0 $y1=0 HotKeySet( "+s", "Start" ) HotKeySet( "+e", "end" ) While 1 Sleep (100) WEnd Func Start() While 1 $result = _ImageSearchArea("recycle2.bmp",1,0,0,200,200,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MsgBox(0,"Found","Found a empty recycle bin in top left corner") EndIf WEnd EndFunc Func End() Exit EndFunc but, this code working. #include <ImageSearch.au3> $x1=0 $y1=0 $result = _ImageSearch("recycle.bmp",1,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MsgBox(0,"Found","Found a recycle bin with stuff here...") EndIf $result = _ImageSearchArea("recycle.bmp",1,0,0,200,200,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MsgBox(0,"Found","Found a recycle bin with stuff in top left corner") EndIf Plz help me.1 point
-
1 point
-
See here... http://www.autohotkey.com/docs/commands/ImageSearch.htm Other than GIF, I have not tested the code for any of the other formats. BTW, for lossy image formats you will need to use the variance parameter or the match will likely fail.1 point
-
1 point
-
1 point
-
1 point