Jump to content

Xyzm

Members
  • Posts

    1
  • Joined

  • Last visited

Xyzm's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I just couldn't believe that AutoIt doesn't have this functionality, and then I was amazed again by how hard it is to find a working "imagesearch" for autoit. I got it to work, more or less, after over 4 hours of trying a dozen DLL's scattered everywhere as well as a dozen .au3's that needed fixing before they worked. The transparency hasn't worked at all and mostly screws the script (thinks it found the image at starting X/Y of the search area). So... is there really no way? Because I love AutoIt, and I'd hate to learn & switch to AHK just because it has 1 simple function that its big brother lacks... /RANT PS: Here's my code. For the picture that it has to find for I tried any file format Opt("MouseCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) Opt("PixelCoordMode", 0) #include <Misc.au3> #include <ImageSearch.au3> $dll = DllOpen("user32.dll") WinWait("com++ test", "") If Not WinActive("COM++", "") Then WinActivate("COM++", "") WinWaitActive("COM++", "") $xxx = 0 $yyy = 0 ;coordinates to search $left = 300 $top = 300 $right = 1300 $bottom = 800 MouseMove($left, $top) Sleep(25) MouseMove($right, $top) Sleep(25) MouseMove($right, $bottom) Sleep(25) MouseMove($left, $bottom) Sleep(25) $MyTolerance = 20 $hasfound = 0 $hasfound = _ImageSearchArea("C:/OBJ_COM_SMALL.bmp", 0, $left, $top, $right, $bottom, $xxx, $yyy, $MyTolerance, 0xff00ff) If $hasfound = 1 Then MouseMove($xxx, $yyy) Sleep(500) MouseClick("right") Send("1") Sleep(2000) Else While $hasfound = 0 $hasfound = _ImageSearchArea("C:/OBJ_COM_SMALL.bmp", 0, $left, $top, $right, $bottom, $xxx, $yyy, $MyTolerance, 0xff00ff) Sleep(200) If $MyTolerance < 200 Then $MyTolerance += 2 Sleep(200) WEnd MouseMove($xxx, $yyy) Sleep(2000) EndIf
×
×
  • Create New...