Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/12/2015 in all areas

  1. 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, Stephan
    2 points
  2. 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
  3. zxtnt09

    [Solved ]if Problem !!!

    Hi guys, i have an issue ! 1 ) i use that and its fine : if $ok then Opt("GUIOnEventMode",0) else error() endif 2 ) now i want need sleep for 5sec , i was use that but it was make delay and make it back to Opt("GUIOnEventMode",0) !! script for dly i used : if $ok then Opt("GUIOnEventMode",0) Sleep(5000) Opt("GUIOnEventMode",1) else error() endifi don't like that , i want delay run when script was load successfuly , it's meant => 1 ) Time for loading program example: 1 sec 2 ) After 5sec ( or X Sec ) program was loaded => Opt("GUIOnEventMode",1) change. thanks for helping and sorry for my bad english. ========================= Solved By Myself i Should Use That : Func buttonloginclick() Local $username, $password $username = GUICtrlRead($inputusername) If NOT $username Then _showerror("Enter Your Username!", $inputusername) Return False EndIf $password = GUICtrlRead($inputpassword) If NOT $password Then _showerror("Enter Your Password!", $inputpassword) Return False EndIf GUICtrlSetState($inputusername, $gui_disable) GUICtrlSetState($inputpassword, $gui_disable) GUICtrlSetState($buttonlogin, $gui_disable) Local $data, $request $data = "username=" & urlencode($username) $data &= "&password=" & urlencode($password) $request = _httprequest($endpoint_login, "POST", $data) If $debug_mode Then _arraydisplay($request) Local $json = json_decode($request[2]) Local $success = json_get($json, '["success"]') GUICtrlSetState($inputusername, $gui_enable) GUICtrlSetState($inputpassword, $gui_enable) GUICtrlSetState($buttonlogin, $gui_enable) If $success Then Opt("GUIOnEventMode",0) GUICtrlSetState($inputusername, $gui_disable) GUICtrlSetState($inputpassword, $gui_disable) GUICtrlSetData($buttonlogin, "Logout") GUICtrlSetOnEvent($buttonlogin, "Logout") ; i Was Should That :) If $success Then Sleep (5000) Opt("GUIOnEventMode",1) EndIF ; i Was Should That :) togglecontrol(1) Return True Else Local $errorcode = json_get($json, '["data"]') If $errorcode = -1 Then _showerror("Your username or password is incorrect!", $inputusername) Return False Else _showerror("You have already logged in at other device. Please logout first!") Return False EndIf EndIf EndFuncMaybe It was help someone <3
    1 point
  4. czardas

    [Solved ]if Problem !!!

    @Ihab_InjeCtor that code is plain wrong. You cannot create a function with the same name as an existing native function. @zxtnt09 I don't entirely understand the question. Using Sleep() pauses the whole script and that might include whatever is loading. Perhaps if you posted more of your code, it would be easier to see what you are trying to do.
    1 point
  5. 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
  6. I don't think skynet will arise as a result of using DllStruct wrong.
    1 point
  7. 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)M23
    1 point
  8. Finally, my code is not so bad...
    1 point
  9. 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
  10. 1 point
  11. 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
  12. Jos

    Mouth on InputBox Edit

    Doesnt _DateTimeFormat() give the requested result? jos
    1 point
  13. I don't remember which line works, but put both in user properties: code.page=65001 output.code.page=65001
    1 point
  14. So this should be better documented in HelpFile . I will do a track ticket but before must change the example of ObjEvent. Thanks. mLipok
    1 point
  15. You need to always know the size of the window and its position and the relative positions of the controls fro the windows position. I just maximize the window to solve this. You'll probably need to check the desktop resolution if its for other computers too. You can imgsearch and pixelgetcolor OCR and pixelchecksums to do most of the rest.
    1 point
  16. Unc3nZureD

    Webcam Detection

    Please use the search button '?do=embed' frameborder='0' data-embedContent>> a little bit modified: MsgBox(0,"", IsWebcamPresent()) Func IsWebcamPresent() $StructName = DllStructCreate("char[1024]") $StructDesc = DllStructCreate("char[1024]") For $i = 0 To 9 $aRslt = DllCall("Avicap32.dll", "bool", "capGetDriverDescription", "dword", $i, "ptr", DllStructGetPtr($StructName), "dword", DllStructGetSize($StructName), "ptr", DllStructGetPtr($StructDesc), "dword", DllStructGetSize($StructDesc)) If Not @error Then If $aRslt[0] Then Return True EndIf Next Return False EndFunc
    1 point
  17. 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
  18. 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
  19. i used the 32 bit too same result.
    1 point
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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 search
    1 point
  25. nice work! thx~
    1 point
  26. I've used this for automating a daily job at work that refreshes +/- 35 reports daily with each one searching, and it hasn't missed a beat. I'm curious as to the difference in .dll files, compared to the one in the original post from 2008. Here's the two versions: Original ImageSearchDLL.dll 92k 2/28/2008 Your ImageSearchDLL.dll 77k 1/24/2010 Can you (or anyone else) tell me what the differences are?
    1 point
  27. therms

    Access AutoIt

    This is the best thing I've ever seen on the internet. Thanks for this!
    1 point
  28. Zedna

    Image Search Library

    You can make UDF wrapper which will call this search function from DLL in a loop. Everytime it find something you must add found coordinates to output array and shrink search area accordingly.
    1 point
  29. Memories

    Image Search Library

    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
  30. pezo89

    Image Search Library

    Fixed my issue with Win7 64bit. Thx alot. it works now!
    1 point
  31. rapot

    Image Search Library

    #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.bmp
    1 point
  32. Earthgas

    Image Search Library

    i think this will make GUI window to full screen mode but i need that when i open it it would dissable everithing that is out side of GUI and search,and do things only in GUI forgetting about rest of desktop i fail at explaining
    1 point
  33. 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 confused
    1 point
  34. therms

    Image Search Library

    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
  35. Sven

    Image Search Library

    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
  36. ygm

    Image Search Library

    How to use this on a windows? So not on the desktop, but in the windows file browser or something like that.
    1 point
  37. Zedna

    Image Search Library

    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
  38. bf2forlife

    Image Search Library

    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 work
    1 point
  39. ssjdennis

    Image Search Library

    It was a example, but can you help me???
    1 point
  40. Kickassjoe

    Image Search Library

    When I first started using AutoIt, this is the type of thing I was looking for, looks nice
    1 point
  41. JRSmile

    Image Search Library

    This is great, dude. Already included it into my projects. VERY MUCH THX
    1 point
  42. kangkeng

    Image Search Library

    Haven't tried out your code, but I don't think you should have the While 1 and WEnd in the Func, unless you want to repeatedly show the message box.
    1 point
  43. ssjdennis

    Image Search Library

    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
  44. 1 point
  45. kangkeng

    Image Search Library

    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
  46. ssjdennis

    Image Search Library

    what file type can I use???
    1 point
  47. A. Percy

    Image Search Library

    Perfect!
    1 point
  48. hey, this rocks, thanks
    1 point
  49. ssjdennis

    Image Search Library

    Thx It working 100%
    1 point
×
×
  • Create New...