BatMan22 Posted March 5, 2018 Share Posted March 5, 2018 Anyone happen to have imagesearch library to upload? The link on the forums seems dead? Or am I looking at the wrong spot (see below)? For the record, not for gaming, just tired of trying to make MS UIU work, even once I solved everything and got it to click where I wanted... the program is old and buggy so it crashes 20-30% of the time and it drives me crazy (not MS UIU fault) . So I think the only option I have left is image search right?I know it's the worst way to go about solving the issue but the using click coordinates changes between PC's with different screen resolutions even with windowed mode. Link to comment Share on other sites More sharing options...
Xandy Posted March 5, 2018 Share Posted March 5, 2018 (edited) Video is long at 4 minutes, but it shows setting up an Image and dynamically detecting on screen. The image detected is the Notepad.exe icon at Left / Top of Notepad window. If $win_title <> '' Then ; Use Window Title If $cursor = 1 Then ;one of these guys (might still) leak memory when returning the cursor data $hscreen = _ScreenCapture_CaptureWnd("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor) ;I won't leak the cursor ;out($win_title &": Show Cursor SCREENSHOT AREA: " & $area_x & " " & $area_y & " " & $area_x + $area_w & " " & $area_y + $area_h) Else $hscreen = _ScreenCapture_CaptureWndV2("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor);, $iBitBltFlag) ;out($win_title &": Hide Cursor SCREENSHOT AREA: " & $area_x & " " & $area_y & " " & $area_x + $area_w & " " & $area_y + $area_h) ;$hscreen = _ScreenCapture_CaptureWndV2("screenshot.bmp", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor);, $iBitBltFlag) EndIf Else ; Save Screenshot to Compare with Rect ; These are seporated to figure if one still leaks the cursor If $cursor = 1 Then ;one of these guys leaks memory when returning the cursor data $hscreen = _ScreenCapture_Capture("", $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor) ;I won't leak the cursor Else $hscreen = _ScreenCapture_CaptureV2("", $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor, $iBitBltFlag) ;I help you get pixel data from layered windows EndIf EndIf ; win_title <> '' Edited March 5, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Xandy Posted March 5, 2018 Share Posted March 5, 2018 (edited) Snippet of required functions. Above. Double post b/c couldn't get editor to do what I wanted with text and Images. Edited March 5, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
BatMan22 Posted March 5, 2018 Author Share Posted March 5, 2018 @Xandy Hmm.. I would really prefer to use an internal imagesearch library.. not an external program that my program calls or is called by. Cool video, I want to do basically exactly that. I just plan to do with with the imagesearch library on the forums, but the link is broken. Link to comment Share on other sites More sharing options...
Xandy Posted March 5, 2018 Share Posted March 5, 2018 (edited) I showed you the code. What else do you need? The only library I know how to use, is the one I illustrated . Edited March 5, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
BatMan22 Posted March 5, 2018 Author Share Posted March 5, 2018 (edited) @Xandy Wait what? I don't see a search function in your script? Your script just captures the screen right? Also I need the actual library files.. that's why I posted... aka.. the link that I linked to ImageSearchLibrary is dead. Edited March 5, 2018 by BatMan22 Link to comment Share on other sites More sharing options...
Xandy Posted March 5, 2018 Share Posted March 5, 2018 Okay. I iterate through pixels and compare with _GDIPlus_BitmapGetPixel. You might not need _ScreenCapture_CaptureV2. _ScreenCapture_CaptureWnd() comes with AutoIt I think. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Xandy Posted March 6, 2018 Share Posted March 6, 2018 If _GDIPlus_BitmapGetPixel($hbmpscreen, $x, $y) = _GDIPlus_BitmapGetPixel($hbmprect, $x, $y) Then $pixel_match += 1 EndIf Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
BatMan22 Posted March 6, 2018 Author Share Posted March 6, 2018 @Xandy, thanks dude. If I can't find the imagesearch library somewhere then I will have to do that. I appreciate your help. Link to comment Share on other sites More sharing options...
BatMan22 Posted March 6, 2018 Author Share Posted March 6, 2018 (edited) Found it! Edited March 6, 2018 by BatMan22 Link to comment Share on other sites More sharing options...
Xandy Posted March 6, 2018 Share Posted March 6, 2018 (edited) Show us what you found? Edited March 6, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
BatMan22 Posted March 7, 2018 Author Share Posted March 7, 2018 @Miliardsto hooked me up with the files he used here and the github for that is: https://github.com/ellysh/ImageSearch But I haven't had time to test that yet.. but what worked for me was the attached zip file, I butchered the Example File so if you should know that other available functions are listed in the _ImageSearch.au3 file, four total (_IMGSearch_Area, _IMGSearch, _IMGSearch_Wait, _IMGSearch_WaitArea) image files.zip Xandy 1 Link to comment Share on other sites More sharing options...
Miliardsto Posted March 10, 2018 Share Posted March 10, 2018 your example works for me . no error . try to downgroad autoit version Link to comment Share on other sites More sharing options...
BatMan22 Posted March 11, 2018 Author Share Posted March 11, 2018 On 3/10/2018 at 11:31 AM, Miliardsto said: your example works for me . no error . try to downgroad autoit version I think you misunderstood, I posted it because it worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now