Leaderboard
Popular Content
Showing content with the highest reputation on 03/05/2021 in all areas
-
HandleImgSearch (Image Search with ImageSearchDLL embedded)
mutleey reacted to lamnhan066 for a topic
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 uses a pure AutoIT loop to make the multiple positions returned work so it may be slower if you set the $MaxImg to a high number. Some highlights: Very fast with imagesearchdll embedded, no external files required. Tolerances and Max Images are supported. Optimized. Use with a handle or full screen easily. Included global functions, so you can run multiple functions in one capture. Examples used for testing included. Notes: Only used to compile to 32-bit AutoIt version (It can completely run on Windows 64-bit) The image used for searching should be in a "24-bit Bitmap" format. I included the $IsUser32 variable in some places like _GlobalImgInit, _HandleCapture. This variable allowed you to use DllCall with the "PrintWindow" parameter instead of _WinAPI_BitBlt with $SRCCOPY. $IsUser32 = True is useful for the window explorer handle, $IsUser32 = False is useful for the emulator handle (NoxPlayer handle example included). If hwnd parameter equals "", it will use the 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 the 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 the picture in the picture instead of the handle. _HandleGetPixel: Get pixel in the handle image. _HandlePixelCompare: Compare color with pixel color of handle image. _HandleCapture: Capture handle screen. Source code: v1.0.5 (First release): https://github.com/vnniz/HandleImgSearch/releases/tag/v1.0.5 v2.0.0 (14/04/2023): https://github.com/vnniz/HandleImgSearch/releases/tag/v2.0.0 Thanks to: 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.1 point -
Creating a checklist - (Moved)
Keybanger reacted to argumentum for a topic
#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\dadda\OneDrive\Documents\CheckList.kxf $TradeInfo_1 = GUICreate("TradeInfo", 396, 196, 0, 0) GUISetBkColor(0x000000) $TextField = GUICtrlCreateEdit("", 24, 12, 345, 113, BitOR($ES_CENTER,$ES_WANTRETURN), 0) GUICtrlSetData(-1, "") GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x1D276A) GUICtrlSetBkColor(-1, 0x060606) $Back = GUICtrlCreateLabel("Back", 56, 144, 113, 33, $SS_CENTER) GUICtrlSetFont(-1, 17, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x1D276A) GUICtrlSetBkColor(-1, 0x020005) $Next = GUICtrlCreateLabel("Next", 200, 144, 117, 33, $SS_CENTER) GUICtrlSetFont(-1, 17, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x1D276A) GUICtrlSetBkColor(-1, 0x020005) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $count = 1 Global $aArray = ThisArrayFromFile() Func ThisArrayFromFile() Local $sFileRead = "" ; FileRead("myfile") $sFileRead &= 'Open TOS and AutoIt Apps on Far-Right PC. ' & @CRLF $sFileRead &= 'Open TOS and AutoIt apps on all stations but don’t log in to TOS and do not load the "Hide White Bar" yet. ' & @CRLF $sFileRead &= 'Set up Daily levels on Far-Right PC. ' & @CRLF $sFileRead &= 'Log-in on all stations' & @CRLF $sFileRead &= 'Minimize all TOS Main Screens Except on Tower' & @CRLF $sFileRead &= 'HP Touch' & @CRLF $sFileRead &= 'Open OBS Studio and adjust position if needed' & @CRLF Return StringSplit($sFileRead, @CRLF, 1) EndFunc GUICtrlSetData($TextField, $aArray[$Count]) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Next $Count += 1 Message() Case $Back $Count -= 1 Message() EndSwitch WEnd func message() If $Count < 1 Then $Count += 1 Return EndIf If $Count > $aArray[0] - 1 Then $Count -= 1 Return EndIf GUICtrlSetData($TextField, $aArray[$Count]) EndFunc1 point -
I think the issue raised is clear and don't need suggestions for workaround as that was also already made clear.1 point
-
Default Icon Remains Inside the Compiled EXE
Trong reacted to argumentum for a topic
No @VIP, it is better to replace it than to delete it. Test around and you'll see why. Edit: oh, missed the joke, lol1 point -
#RequireAdmin was used. If found another solution for the command line wmic /namespace:\\root\CIMV2\Security\MicrosoftTpm path Win32_ Tpm get /value With this it works fine and I got what I want. 😉1 point
-
convert string character
MASKED reacted to AspirinJunkie for a topic
Another variant would be to set the option "ExpandVarStrings": Opt("ExpandVarStrings", 1) Local $variable1 = 1 Local $variable2 = 2 Local $tmp For $i = 1 to 2 $tmp = "$variable" & $i & "$" MsgBox (0, "", $tmp) Next But also here applies what Nine already said: Use arrays instead.1 point -
People post tidbits and full scripts here purposely to share, all the while knowing others will modify their stuff to meet their own needs. Rogue5099 has not logged in almost 1 year and I doubt this person is coming along anytime soon just to tell you to go ahead do as you please with what they shared here. If your modifications can help others, then by all means, post your mods to this thread too.1 point
-
LAST VERSION - 3.8 03-Jul-12 This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library. The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTEProperties and ...SciTEAPI, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions? Credits Available functions Files to download WinAPIEx UDF v3.8 for AutoIt 3.3.6.1 Previous downloads: 27953 WinAPIEx UDF v3.8 for AutoIt 3.3.8.x Previous downloads: 148501 point
-
WinAPIEx UDF
pixelsearch reacted to argumentum for a topic
@Matt_Murdoch, as @Melba23 said, it's no longer needed but, there are the files1 point -
Extended Path Checked (should have worked ok in 3.3.12.0) ========================================================= DirCreate DirGetSize FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetSize FileGetShortName FileGetTime FileGetVersion FileRead FileReadLine FileReadToArray FileSetPos FileWrite FileWriteLine Extended Path Fixed in 3.3.13.1+ (Didn't work correctly in 3.3.12.0) ==================================================================== FileCopy FileDelete FileMove FileOpen (when used with DirCreate flag) Extended Path Rewrite Needed ============================ DirCopy (shell32) DirMove (shell32) DirRemove (shell32) FileSetAttrib FileSetTime FileCreateNTFSLink FileInstall IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection Extended Path Incompatible (Underlying API does not support) - Some may be possible to rewrite ============================================================================================== FileChangeDir (no function exists that can set directory with long paths) FileCreateShortcut (shell32) FileGetShortcut (shell32) FileOpenDialog (shell32) FileRecycle (shell32) FileRecycleEmpty (shell32) FileSaveDialog (shell32) FileSelectFolder (shell32)1 point
-
WinAPIEx UDF
pixelsearch reacted to guinness for a topic
A couple more additions. ConsoleWrite("SetDoubleClickTime = " & _WinAPI_SetDoubleClickTime(500) & @LF) ConsoleWrite("GetDoubleClickTime = " & _WinAPI_GetDoubleClickTime() & @LF) Func _WinAPI_GetDoubleClickTime() Local $Ret = DllCall('user32.dll', 'uint', 'GetDoubleClickTime') If @error Then Return SetError(1, 0, 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_GetDoubleClickTime Func _WinAPI_SetDoubleClickTime($iTime) Local $Ret = DllCall('user32.dll', 'int', 'SetDoubleClickTime', 'uint', $iTime) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_SetDoubleClickTime1 point -
Capturing double clicking in an input box
pixelsearch reacted to BugFix for a topic
Another way: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $ret = DllCall("user32", "long", "GetDoubleClickTime") Global $dblClickTime = $ret[0] Global $timer, $clicked = False Global $aInput[4] $Form1 = GUICreate("Form1", 633, 454, 193, 115) GUISetOnEvent($GUI_EVENT_CLOSE, '_ende') GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_primary') $aInput[0] = GUICtrlCreateInput("", 100, 60, 200, 20) $aInput[1] = GUICtrlCreateInput("", 100, 90, 200, 20) $aInput[2] = GUICtrlCreateInput("", 100, 120, 200, 20) $aInput[3] = GUICtrlCreateInput("", 100, 150, 200, 20) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _ende() Exit EndFunc Func _primary() Local $time If $clicked Then $time = TimerDiff($timer) EndIf Local $cursor = GUIGetCursorInfo(), $match = False Local $ID = $cursor[4] For $i = 0 To UBound($aInput) -1 If $aInput[$i] = $ID Then $match = True ExitLoop EndIf Next Select Case Not $match Return Case $time > $dblClickTime $timer = TimerInit() Return Case Not $clicked $clicked = True $timer = TimerInit() Case Else $clicked = False GUICtrlSetData($ID, 1) EndSelect EndFunc1 point -
hi guys i am using imagesearch2015 library. (used another one before) but transparency parameter doesn't working. how i can solve this problem. here's my code #include "ImageSearch2015.au3" #include <Date.au3> ; Script Start - Add your code below here Global $x = 0 Global $y = 0 HotKeySet("{UP}","hey") HotKeySet("{DOWN}","heyo") Func hey() $balikcisaniye = _Date_Time_GetTickCount() $array = _ImageSearchArea("bul.bmp", 1, 0, 0, @DesktopWidth, @DesktopHeight, $x, $y, 2,0x000000) if($array = True) Then $balikcisaniye1 = _Date_Time_GetTickCount() MouseMove($x,$y) MsgBox(1,"","Found." & $x & "-" & $y & " / " & $balikcisaniye1-$balikcisaniye) Else MsgBox(1,"","Not Found.") EndIf EndFunc Func heyo() exit EndFunc while 1 WEnd when i disable transparency parameter, it work normal. but with parameter, this function is always returning false. please help. here's library i use :0 points