Added Image...I am trying to work out Imagesearch but Its not working perfectly.After pressing Hotkey,Mouse not moving to targeted picture.I tried so hard but still not working.So i post here,need help
If possible please add or edit the comments to explain how this works.
;includes functions from other things
Global $win_title ;name of the window
Global $area_x ;
Global $area_y ;
Global $area_w ;
Global $area_h ;
Global $cursor ;
Global $rect_file ;
Global $hbmpscreen ;
Global $i= 1043 ;moves the rect
Global $ii= 378 ;moves the rect
Global $x=1044 ;inner rect offset
Global $y=501 ;inner rect offset
Global $hbmprect ;image inside rect
Global $hscreen ;image whole screen
;display hotkeys on screen
ToolTip("Press F1 to scan | Press ESC to Exit",0,0)
;infinite loop to keep prog running
;~ reads your screen area:
;~ converts screen captured into bmp
;~ . Loads converted bmp to be read
;~ compares the bmp of your scanned screen to the actual screen that is being displayed
$hscreen = _ScreenCapture_CaptureWnd("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor)
;converts screen into bmp
;loads converted screen
;compares savedBMP to current screen
;If( below code ) = ( below code ) Then
If _GDIPlus_BitmapGetPixel($hbmpscreen, ($i + $x) - $area_x, ($ii + $y) - $area_y) = _GDIPlus_BitmapGetPixel($hbmprect, $x, $y) Then
;display message box titled found with a message of found
;if above is not correct then
Do you have a working imagesearch.au3 with working dll?
and how can i gethandle and send keyboard/mouse commands to hidden d3d window?
i have tried imagesearch2015 but im getting dll error every time and tried older imagesearchs too in forum what i found.
i have tried many things to send commands to hidden/background d3dwindow still nothing works.
Can you help me please?
Hello. I've been working with Imagesearch library lately and it did a good work, although I moved to a new PC and didn't copy the old files with me so I downloaded the Imagesearch from the following post
hoping that it will work. It doesn't though. First time I when I use (run as subscript to my code) the Imagesearch.au3, Scite finds errors (missing spaces). Ctrl+T (scite tidy) fixes these missing spaces but the script returns the following error on every run after:
_ImageSearch('search.bmp', 0, $x, $y, 0) outputs
"C:\Users\Knuckles\Desktop\AutoIt\include\ImageSearch.au3" (44) : ==> Subscript used on non-accessible variable.: If $result = "0" Then Return 0 If $result^ ERROR no matter if I put the searched bmp in the script folder or folder img in the script directory. Also, it doesn't matter if the searched image on screen or not, it returns the same.
Can you provide me any help please? I remember having these problems 2 years ago when I first met the imagesearch library also (I fixed it somehow though in that time). Seems nothing changed.
Using this version posted in the following post gives the same error:
Also I run windows 10 64bit and I have no shell options for script editing, running as x86 or whatever as I used to have on windows xp/7. I went through some steps like deleting a key in registry and I even reinstalled autoit and scite but that only resulted to au3 as unrecognized file format and not in getting back the menus and the icon on au3 files. Any thoughts on this?
Edit: Installing 64-bit AutoIt and using 64bit ImageSearch is no change.
FOUND WORKING: http://www.codebot.de/index.php/Thread/12713-Imagesearch-au3-funktioniert-nicht/
but why is this one working and the original aren't? :(
I had made a bot that clicks and doing stuff. It is working fine, but when i move it to another PC ImageSearch stop working. I captured same image of a button again and i observed that they are a little bit different. How to deal with this? I wonder if i will make black and white detection might work, or not ... i don't know. The point is i am not willing to re-do photos on each and every PC i move the scripts.
ClickOnImageWithToleranceFast("images/fb_about.bmp",16) Func ClickOnImageWithToleranceFast($image_path,$tolerance) If SearchForImageOnScreenWithTolerance($image_path,$tolerance) Then If $x <> 0 And $y <> 0 Then MouseMove($x+5, $y+5,0) Sleep(500) MouseClick("left") Sleep(500) EndIf EndIf EndFunc
Link : https://postimg.org/gallery/z6n168ps/585debf1/#
Also i have attached them.