Pixel search in defined area inside defined app autoit -
okay, know it's simple cant work. want pixel search function defined area in defined application. application need work bluestack.

blue rectangle app (and position moved) -> position using controlgetpos
now want pixel search in red rectangle inside app. position of red rectangle 307,628,355,675 based on window info windows coordinat mode. it's not working, please help. in advance
here's code :
hotkeyset("{f2}", "mulai") hotkeyset("{f3}", "berhenti") global $lokasi[2] global $warna global $penghitung global $nyala global $title = "bluestacks app player" global $hwnd = wingethandle($title) global $bspos func berhenti() exit endfunc ;==>berhenti func getpos() $apos = controlgetpos($title, "", "[class:bluestacksapp; instance:1]") $tpoint = dllstructcreate("int x;int y") dllstructsetdata($tpoint, "x", $apos[0]) dllstructsetdata($tpoint, "y", $apos[1]) _winapi_clienttoscreen(wingethandle(wingettitle($title)), $tpoint) $bspos[0] = dllstructgetdata($tpoint, "x") $bspos[1] = dllstructgetdata($tpoint, "y") endfunc ;==>getpos func mulai() $nyala = 1 while $nyala = 1 $pos = wingetpos($hwnd) winactivate($hwnd) $lokasi = pixelsearch($bspos[0] , $bspos[1], $bspos[0] + $bspos[2], $bspos[1] + $bspos[3], 0x0185b3) mousemove($lokasi[0], $lokasi[1], 0) sleep(200) if @error $penghitung = $penghitung + 1 endif if $penghitung > 5 $nyala = 0 endif wend endfunc ;==>mulai while 1 sleep(200) wend
it seems there's nothing wrong imagesearch library, problem running windows 10 using x64bit. compiling using x64 compiler (while suggest use x86 compiler) administrator previllige solved problem.
Comments
Post a Comment