This topic is now closed to further replies.
Recently Browsing 0 members
No registered users viewing this page.
Today, I will share my work with image search in inactive windows (windows that run in the background) with tolerances (variations).
After a long time of searching and using image search UDF on the internet. I combined all of that with my experienced and created a UDF name HandleImgSearch.
I have embedded the .dll file in this script so it doesn't need any external files, just include it and run. However, this UDF have a feature that will make it run slower is $MaxImg variable, this variable will allow you to return multiple positions of a finding image.
Very fast with imagesearchdll embedded, no external files required. Tolerances and Max Images are supported. Optimized. Use with handle or full screen easily. Included global functions, so you can run multiple functions in one capture. Examples used for testing included. Notes:
Only use to compile to 32 bit AutoIt version (It can completely run on Windows 64 bit) Image use for searching should be a "24-bit Bitmap" format. I included $IsUser32 variable in some places like _GlobalImgInit, _HandleCapture. This variable allowed you to use DllCall with "PrintWindow" parameter instead of _WinAPI_BitBlt with $SRCCOPY. $IsUser32 = True is useful for window explorer handle, $IsUser32 = False is useful for the emulator handle (NoxPlayer handle example included). If hwnd parameter equal "", it will use whole screen instead. Functions:
Global Functions: Run multiple functions with one capture. _GlobalImgInit: Initialization variables. _GlobalImgCapture: Capture the handle. _GlobalGetBitmap: Get captured bitmap handle. _GlobalImgSearch: This is the main function of this UDF. _GlobalGetPixel: Get pixel color in captured image. _GlobalPixelCompare: Compare pixel color with captured image pixel color. Handle Functions: Capture every time. _HandleImgSearch: This is the main function of this UDF. Search for images in the handle of the window with the tolerance and maximum image options. _BmpImgSearch: Search picture in picture instead of handle. _HandleGetPixel: Get pixel in handle image. _HandlePixelCompare: Compare color with pixel color of handle image. _HandleCapture: Capture handle screen. Source code: https://github.com/ltnhanst94/HandleImgSearch
ImageSearchDLL (Author: kangkeng 2008) MemoryCall (Author: Joachim Bauch) BinaryCall (Author: Ward) GAMERS - Asking for help with ANY kind of game automation is against the forum rules. DON'T DO IT.
hi below i got one script i made which runs audacity starts a recording and ends it at specific times
when i run the script even if it isn't the time to start audacity and sits idle on taskbar the pc fan gets very loud, when i close the script it comes back to normal
why this happens ? anything wrong with my code ?? cheers
#include <INet.au3> #include <Array.au3> #include <WinAPIFiles.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <string.au3> #include <FTPEx.au3> #include <ClipBoard.au3> #include <date.au3> #include <ProgressConstants.au3> #include <IE.au3> #Include <Constants.au3> #Include <INET.au3> #include <SendMessage.au3> #include <File.au3> #include <String.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Misc.au3> #include <FileConstants.au3> #include <WinAPI.au3> while 1 if @HOUR = '11' And @MIN = '00' Then Run("C:\Program Files (x86)\Audacity\audacity.exe", "", @SW_MAXIMIZE) SLEEP(2000) if ProcessExists("audacity.exe") Then winactivate("Audacity") EndIf Send("r") ;;KREVATI Sleep(1000 * 60) endif if @HOUR = '23' And @MIN = '00' Then if ProcessExists("audacity.exe") Then winactivate("Audacity") EndIf Send("s") Sleep(1000 * 60) EndIf wend
Maybe you can help me with something small.
It is not terrible but it slows down my script and after a while even crash the script.
First i explain what i have;
I have a GUI with a lot of GUICtrlCreateInput controls, lets say 600 pieces.
All the controls are hidden when the GUI is displayed, i have 3 buttons attached to 200 pieces each.
When i press button-1 the first 200 controls are showed,
When i press button-2 the first 200 controls are hidden and the next 200 controls are showed,
This is working perfectly but after a while the GUI is getting slower and slower.
After a while the controls aren't responding anymore and the script crashes.
When i compile the script to 64-Bits version the speed is a lot better but you can still see the script slowing down each time i use the buttons.
I think there has to be a buffer somewhere that is filling each time i show and hide the controls, but how can i clear that buffer without restarting the script?
Deleting and re-creating the controls didn't help, deleting the entire gui (and controls) and re-creating it didn't help also.
The only thing that is working is restarting the script.
PS: If you need a working example i can add it to this topic, just let me know. It is not rocket science, i just create the controls and show/hide them with a while loop and 3 buttons.
I know the title sounds weird, but i couldn't find better words for it...
I finally managed to have a working image search (yes yes i know image search is evil :p).
I noticed that even if the script is compiled, the images have to be in my script folder.
But i don't want that the images i'm searching for on the screen can be viewed, edited etc by every user.
Is there a way to... uhm... put them in a file like .rar, but one that can't be easily opened? 🤔
Edit: Now that i think of .rar, maybe using a .rar which is protected by a password... Can autoit search, open, extract, use and delete that? (I guess so, I didn't search for this yet, going to google that asap)