Leaderboard
Popular Content
Showing content with the highest reputation on 11/20/2019 in all areas
-
Version 2021.8.30.2
10,235 downloads
Use MouseClick() need: #RequireAdmin Dll is already integrated in UDF ! ; #INDEX# =============================================================== ; Title .........: ImageSearch ; AutoIt Version : 3.x ; Language ......: English ; Description ...: Check image Appears or Not and Return the position of an image on the desktop ; Author(s) .....: Dao Van Trong - TRONG.LIVE ; ======================================================================= ; #CURRENT# ============================================================= ; _ImageSearch ; _ImageSearch_Area ; _ImageSearch_Wait ; _ImageSearch_WaitArea ; ======================================================================== ;========================================================================= ; ; Author:...........: AutoIT VietNam : Dao Van Trong - TRONG.LIVE ; Description:......: Check image Appears or Not ; Find and return the position of an image on the desktop ; Syntax:........... _ImageSearch_Area, _ImageSearch ; Parameter(s):..... $_ImagePath: The image to locate on the desktop ; May be a list of image by delimited by "|" ; i.e: $_ImagePath = "image1.bmp|image2.bmp|image3.bmp" ; $P_x1 $P_y1: Position of 1st point ; $P_x2 $P_y2: Position of 2nd point - Default is last botton right of desktop ; $_Tolerance: 0 for no tolerance (0-255). Needed when colors of image differ from desktop. e.g GIF ; $_CenterPos: boolen. True will return $array[1] x $array[2] is center of image found. ; False will return top-left position ; Return Value(s):.. Return an array has 3 item ; On Success: $array[0] 1 ; On Failure: $array[0] 0 ; DLL not found or other error: $array[0] -1 ; $array[1] x $array[2]: position of image what found on desktop ; ; Note:............. Use _ImageSearch to search the entire desktop ; _ImageSearch_Area to specify a desktop region to search ; $_ImagePath with more item need more time appear on screen before function can detect. ; Decrease sleep time in the loop to detect faster. But less performance. I.e CPULoad increased ; ;======================================================================== EG 1: ;~ Opt("MustDeclareVars", 1) ;~ #AutoIt3Wrapper_UseX64=y ;~ #AutoIt3Wrapper_Change2CUI=y #RequireAdmin #include "_ImageSearch_UDF.au3" HotKeySet("{Esc}", "_Exit") ; Press ESC for exit Func _Exit() Exit 0 EndFunc ;==>_Exit Global Const $Ask_On_Found = 0 Global Const $Mouse_Move_On_Found = 1 Global Const $Mouse_Click_On_Found = 0 Global Const $iSleep_Time=500 Global $sCount = 0, $_Image_1 = @ScriptDir & "\example.bmp" ; First, use this function to create a file bmp, maybe a desktop icon for example') MsgBox(64 + 262144, 'ImageSearch', 'At first, create a file bmp,' & @CRLF & 'photos that will search on the screen!') _ImageSearch_Create_BMP($_Image_1) ConsoleWrite("! Search for images: " & $_Image_1 & @CRLF & '! Searching on the screen ...' & @CRLF) While 1 ToolTip('(Press ESC for EXIT) Searching ...', 1, 1) Sleep($iSleep_Time) $sCount += 1 Local $return = _ImageSearch($_Image_1) If $return[0] = 1 Then ConsoleWrite('- [' & $sCount & '] Image found:' & " X=" & $return[1] & " Y=" & $return[2] & @CRLF) If $Mouse_Move_On_Found Then MouseMove($return[1], $return[2]) Sleep($iSleep_Time) EndIf If $Mouse_Click_On_Found Then MouseClick("left", $return[1], $return[2]) ToolTip('(Press ESC for EXIT) - [' & $sCount & "] Image found:" & " X=" & $return[1] & " Y=" & $return[2], 1, 1) If $Ask_On_Found Then Local $ask = MsgBox(6 + 262144, 'Success [' & $sCount & ']', 'Image found:' & " X=" & $return[1] & " Y=" & $return[2]) If $ask = 2 Or $ask = 3 Or $ask = 5 Or $ask = 7 Then Exit ;No, Abort, Cancel, and Ignore If $ask = 10 Then _ImageSearch_Create_BMP($_Image_1) ; Continue ;Try Again EndIf EndIf Sleep(200) WEnd Video demo: [+] When any problem or error occurs, please make sure that:- Downloaded and used the latest version.- Set screen Screen Scale and layout = 100%- Installed display driver.- Tried turning off the antivirus- Full installation: Microsoft Visual C++ Redistributable 2005->2022 [+] You can download the AIO version of the Visual C++ Redistributable here: -> https://www.mediafire.com/file/0ak8dcj9mdn7nyq/VisualCppRedist_AIO_2005-2022_x86_x64_%5Btrong.live%5D.zip/file -> FOR Windows XP: https://www.mediafire.com/file/5m5lnr1kfg73tc9/VisualCppRedist_AIO_2005-2019_x86_XP_%5Btrong.live%5D.zip/file <!> Password for Extract: trong.live [+] The last full version of SCITE4AutoIT supports windows XP: https://www.autoitscript.com/autoit3/scite/download/archive/v19.1127.1402.0-SciTE4AutoIt3.exe1 point -
FModMem UDF build 2019-11-24
argumentum reacted to UEZ for a topic
Hi, I created a FMOD UDF (x86 / x64 compatible) whereas the DLL calls are done from memory directly! Credits to trancexx for the Subrogation functions! Supported formats: - .MOD (protracker/fasttracker modules) - .S3M (screamtracker 3 modules) - .XM (fasttracker 2 modules) - .IT (impulse tracker modules) - .MID (MIDI files) - .RMI (MIDI files) - .SGT (DirectMusic segment files) - .FSB (FMOD Sample Bank files) - .MP3 - .OGG - .WAV - .MP2 - .RAW Current added function list (sum = 70): FMUSICMEM_FreeSong FMUSICMEM_GetBPM FMUSICMEM_GetGlobalVolume FMUSICMEM_GetMasterVolume FMUSICMEM_GetName FMUSICMEM_GetNumChannels FMUSICMEM_GetNumInstruments FMUSICMEM_GetNumOrders FMUSICMEM_GetNumPatterns FMUSICMEM_GetNumSamples FMUSICMEM_GetOrder FMUSICMEM_GetPaused FMUSICMEM_GetRow FMUSICMEM_GetSpeed FMUSICMEM_GetTime FMUSICMEM_GetType FMUSICMEM_IsFinished FMUSICMEM_LoadSong FMUSICMEM_LoadSongEx FMUSICMEM_OptimizeChannels FMUSICMEM_PlaySong FMUSICMEM_SetMasterVolume FMUSICMEM_SetOrder FMUSICMEM_SetPaused FMUSICMEM_StopAllSongs FMUSICMEM_StopSong FSOUNDMEM_Close FSOUNDMEM_DSP_Create FSOUNDMEM_DSP_Free FSOUNDMEM_DSP_GetActive FSOUNDMEM_DSP_GetFFTUnit FSOUNDMEM_DSP_GetSpectrum FSOUNDMEM_DSP_SetActive FSOUNDMEM_DSP_SetPriority FSOUNDMEM_GetAmplitude FSOUNDMEM_GetChannelsPlaying FSOUNDMEM_GetCPUUsage FSOUNDMEM_GetCurrentLevels FSOUNDMEM_GetError FSOUNDMEM_GetFrequency FSOUNDMEM_GetGetSurround FSOUNDMEM_GetMaxChannels FSOUNDMEM_GetPan FSOUNDMEM_GetPaused FSOUNDMEM_GetVolume FSOUNDMEM_Init FSOUNDMEM_SetPaused FSOUNDMEM_SetSpeakerMode FSOUNDMEM_SetSurround FSOUNDMEM_SetVolume FSOUNDMEM_SetVolumeAbsolute FSOUNDMEM_Stream_Close FSOUNDMEM_Stream_FindTagField FSOUNDMEM_Stream_GetLength FSOUNDMEM_Stream_GetLengthMs FSOUNDMEM_Stream_GetNumTagFields FSOUNDMEM_Stream_GetOpenState FSOUNDMEM_Stream_GetPosition FSOUNDMEM_Stream_GetTagField FSOUNDMEM_Stream_GetTime FSOUNDMEM_Stream_Net_GetStatus FSOUNDMEM_Stream_Net_SetMetadataCallback FSOUNDMEM_Stream_Net_SetProxy FSOUNDMEM_Stream_Open FSOUNDMEM_Stream_Play FSOUNDMEM_Stream_PlayEx FSOUNDMEM_Stream_SetLoopCount FSOUNDMEM_Stream_SetPosition FSOUNDMEM_Stream_SetTime FSOUNDMEM_Stream_Stop In the zip archive you can find 6 examples. Download: FModMem UDF build 2019-11-24.zip If you have created additional examples, feel free to post it here.1 point -
I like the approach. It looks simple, but I don't think it is matching only the MAC list, but combinations of MAC bytes.1 point
-
1 point
-
Yes, I'm just googling for something like "stop if first expression is false"1 point
-
The expected result has an intrisic recursive nature, so the natural code structure shall be (head-first) recursive. I'll try to write something.1 point
-
I have released version 1.4.0.0 for you to play with. 1.3.0.0 is still available for download.1 point
-
How do i get the .EXE name of the active window
seadoggie01 reacted to Jos for a topic
Understood, but there is a thin line between monitoring for efficiency and invading employees privacy, so I guess/hope this is made known to them and won't be running hidden. Jos1 point -
Here my try: #include <array.au3> Global $sMAC = '12-34-56-34-14-91' & @CR & _ '12-34-56-80-04-54' & @CR & _ '12-34-56-80-93-11' & @CR & _ '12-34-56-EA-76-0F' & @CR & _ '12-34-56-EA-76-9F' & @CR & _ '12-34-56-EA-78-11' Global $aMACs = StringRegExp($sMAC, "\b[[:xdigit:]-]+\b", 3) Global $aMACs_splitted[UBound($aMACs)][6], $x, $xx, $y For $y = 0 To UBound($aMACs) - 1 $aTmp = StringSplit($aMACs[$y], "-", 3) For $x = 0 To UBound($aTmp) - 1 $aMACs_splitted[$y][$x] = $aTmp[$x] Next Next Global $sRegEx For $x = 0 To UBound($aMACs_splitted, 2) - 1 Dim $aTmp[UBound($aMACs_splitted)] For $y = 0 To UBound($aMACs_splitted) - 1 $aTmp[$y] = $aMACs_splitted[$y][$x] Next $aTmp = _ArrayUnique($aTmp) If $aTmp[0] = 1 Then $sRegEx &= $aTmp[1] Else $sRegEx &= "(" For $xx = 1 To $aTmp[0] $sRegEx &= $aTmp[$xx] & "|" Next $sRegEx = StringTrimRight($sRegEx, 1) & ")" EndIf $sRegEx &= "-" Next $sRegEx = StringTrimRight($sRegEx, 1) ConsoleWrite("RegEx pattern: " & $sRegEx & @CRLF)1 point
-
It depends on how you look at it. One can, eg. change the red texts in this way: Actual scroll behavior -> Respecting horizontal user scroll as good as possible Better horizontal scroll -> Overruling user scroll by code more than neccessary My idea is, as far as I remember, to perform horizontal scrolling in code only if absolutely necessary when there is no space for the control to edit the cell. The 50 pixels is my minimum width for a ComboBox. The idea of making a column along the left or right edge fully visible when editing could be a good idea when the columns are not too wide. But it may not be the best solution if eg. there are columns that are 1000 pixels wide. In a specific situation, finding the solution that suits you is not that difficult. This is also why the code here is just examples. It's much more difficult to make a generally applicable UDF. There are a huge variety of situations to take into account.1 point
-
Purely pseudo stream of thought, but i think this path may eventually get there #include<array.au3> $str = '12-34-56-34-14-91' & @CR & _ '12-34-56-80-04-54' & @CR & _ '12-34-56-80-93-11' & @CR & _ '12-34-56-EA-76-0F' & @CR & _ '12-34-56-EA-76-9F' & @CR & _ '12-34-56-EA-78-11' local $aSplit[0][6] , $sOut _ArrayAdd($aSplit , $str , 0 , "-" , @CR) For $i = 0 to 5 $sOut &= "(" & _ArrayToString(_ArrayUnique($aSplit , $i , 0 , 0 , 0) , "|") & ")-" Next msgbox(0, '' , stringtrimright($sOut , 1))1 point
-
#include <Clipboard.au3> #include <Array.au3> HotKeySet("{ESC}", "_Exit") Local $aFormats[3] = [2, $CF_UNICODETEXT, $CF_TEXT] _ArrayDisplay($aFormats) While True If _ClipBoard_GetPriorityFormat($aFormats) = -1 Then ContinueLoop ;;; Other stuff WEnd Func _Exit() Exit EndFunc ;==>_Exit EDIT : @Danp2 was a bit faster1 point
-
Your array has the wrong structure (first element should be format count)1 point
-
That is part of the output lexer where it is checking for all kinds of error/warnings of the different known compilers, check out LexErrorList.cxx for all possibilities. Jos1 point
-
Read data from specific Row
CiaronJohn reacted to water for a topic
One last comment: The wiki is a good source: https://www.autoitscript.com/wiki/Excel_Range#Entire_Row_.2F_Entire_Column1 point -
ArrayDisplay
Bishop12 reacted to FrancescoDiMuro for a topic
@Bishop12 WinList() returns a 2-dimension array that lets you access the elements in this way: $arrArray[$intRow][$intColumn] To have access to the first element of the array which contains a title/handle of a window, you have to start from index 1, sine the 0th index (for both row and column) is reserved to handle the number of windows found. So, if you want to use WinActivate() for a specific window, use an InputBox to let the user choose which window wants to activate, and then use the WinActivate() function with the proper syntax explained just above1 point -
Read data from specific Row
CiaronJohn reacted to argumentum for a topic
save as CSV and read the line you wanna get1 point -
RegExp Multiline Comments
seadoggie01 reacted to mikell for a topic
Sometimes using a first step just before the main regex can make the thingy sooo easy... Local $s = "#include <Inet.au3>" & @CRLF & _ "#ToDo: This is a really long explanation about something _" & @CRLF & _ "# that is very in-depth and needs to take up a lot of _" & @CRLF & _ "# space in a ToDo comment" & @CRLF & _ 'Global $variables = "Bad"' & @CRLF & _ "#ToDo: This is another long explanation about something _" & @CRLF & _ "# that is very in-depth and needs to take up a lot of space in a ToDo comment" & @CRLF & _ "#include <IE.au3>" $r1 = StringRegExpReplace($s, '\h*_\h*\R#\h*', " ") Msgbox(0,"", $r1)1 point -
Reading Stdout it seems like the path backslash needs to be escaped: $s_ media_location = StringReplace($s_ media_location,"\","/\") Simple debugger: AdlibRegister("_ReadStdout",250) Func _ReadStdout() ConsoleWrite(StdoutRead($i_mplayer_pid) & @crlf) EndFunc1 point
-
When listview loses focus,the selected item,How to keep blue
pixelsearch reacted to Subz for a topic
Never could figure out a clean way to do this, so used the following hack: #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Global $listview Example() Func Example() Local $button, $item1, $item2, $item3, $msg GUICreate("LISTVIEW", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) $listview = GUICtrlCreateListView("NO1 |NO2|NO3 ", 10, 10, 200, 150, $LVS_SINGLESEL, $LVS_EX_FULLROWSELECT) $button = GUICtrlCreateButton("BUTTON", 75, 170, 70, 20) $item1 = GUICtrlCreateListViewItem ("A1|A2|A3", $listview) $item2 = GUICtrlCreateListViewItem ("B1|B2|B3", $listview) $item3 = GUICtrlCreateListViewItem ("C1|C2|C3", $listview) $item4 = GUICtrlCreateListViewItem ("D1|D2|D3", $listview) $item5 = GUICtrlCreateListViewItem ("E1|E2|E3", $listview) GUICtrlCreateInput("", 20, 200, 150) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") Do $msg = GUIGetMsg() Select Case $msg = $button MsgBox(0, "", GUICtrlRead(GUICtrlRead($listview)), 2) Case $msg = $listview MsgBox(0, "", "" & GUICtrlGetState($listview), 2) EndSelect Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ; Local $tBuffer $hWndListView = $listview If Not IsHWnd($listview) Then $hWndListView = GUICtrlGetHandle($listview) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $iIDFrom Case $listview Switch $iCode Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button For $i = 0 To _GUICtrlListView_GetItemCount($listview) _GUICtrlListView_SetItemDropHilited($listview, $i, False) Next $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _GUICtrlListView_SetItemDropHilited($listview, DllStructGetData($tInfo, "Index")) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY1 point -
EddieBoy, Then implement the For-loop in assembler. The zip-file below contains a complete set of resources and templates to use flat assembler code in AutoIt scripts. However, you must download FASM.DLL from the flat assembler forum yourself. FASM.DLL is dated 2017-10-20. Contents in zip-file: fasm\ - Top folder fasm\ - Resources FASM.DLL - Save FASM.DLL here *.au3 - 3 AutoIt include files MsgBox\ - Templates based on MessageBoxW function x64\MsgBox-x64.asm - 64 bit assembler source code x64\MsgBox-x64.au3 - Compiles and runs the assembler code x64\MsgBox-x64.bin - Contains the binary code (generated by MsgBox-x64.au3) x64\MsgBox-x64.txt - Binary code as text string (generated by MsgBox-x64.au3) x64\MsgBox-x64.log - Information about compilation (generated by MsgBox-x64.au3) x86\ - 32 bit templates MsgBox-1.au3 - Loads and executes fasm code from binary string MsgBox-2.au3 - Loads and executes fasm code from binary file This is the x64 and x86 source files. MsgBox-x64.asm: ; flat assembler code ; Documentation ; MessageBoxW( hWnd, pText, pCaption, iType ) ; Parameters: ; rcx : hWnd ; rdx : pText ; r8 : pCaption ; r9 : iType ; [rsp + 40] : pMessageBoxW ; Init directive use64 ; 64 bit code ; Function code mov rax, qword [rsp + 40] ; pMessageBoxW -> rax sub rsp, 40 ; Stack space and alignment call rax ; Call MessageBoxW add rsp, 40 ; Restore stack pointer ; Exit code ret ; Return MsgBox-x86.asm: ; flat assembler code ; Documentation ; MessageBoxW( hWnd, pText, pCaption, iType ) ; Parameters: ; [ebp + 08] : hWnd ; [ebp + 12] : pText ; [ebp + 16] : pCaption ; [ebp + 20] : iType ; [ebp + 24] : pMessageBoxW ; Init directive use32 ; 32 bit code ; Entry code push ebp ; Store base pointer on stack mov ebp, esp ; Use stack pointer as base pointer ; Function code push dword [ebp + 20] ; 4. parameter: iType push dword [ebp + 16] ; 3. parameter: pCaption push dword [ebp + 12] ; 2. parameter: pText push dword [ebp + 08] ; 1. parameter: hWnd call dword [ebp + 24] ; Call MessageBoxW ; Exit code pop ebp ; Restore base pointer from stack ret 20 ; Return and cleanup stack You can try to run the AutoIt scripts in MsgBox folder. Make a copy of the entire MsgBox folder and rename it for your own project. Delete bin-, txt- and log-files. Rename asm- and au3-files for your project. Start coding flat assembler. fasm.7z fasm-NoBins.7z (see post 12 and 13 below)1 point
-
_excel_rangeread
PoojaKrishna reacted to water for a topic
Do you still get the error when you try: $aResult=_Excel_RangeRead($oWorkbook, Default, Default, Default, True)1 point -
Test url if is valid
PoojaKrishna reacted to guinness for a topic
But if the site is down and the URL is valid the code above will return False. I though a regular expression would have been suggested by PhoenixXL, but honestly I prefer _WinAPI_UrlIs() in WinAPIShPath.au3.1 point -
Test url if is valid
PoojaKrishna reacted to PhoenixXL for a topic
Example $sURL = "http://test/21-04-2014" InetGetSize($sURL) If @error Then ConsoleWrite("Invalid URL" & @CRLF) Else ConsoleWrite("Valid URL" & @CRLF) EndIf Regards Phoenix XL1 point -
Removing Characters Contained in HTML Tags
PoojaKrishna reacted to Melba23 for a topic
Kevitto, Just what RegExes are designed for: $sString = '<br /><span style="font-size: 14pt; font-weight: normal; font-style: italic;">(téléchargement manuel ou guide de référence)</span> ' $sStripped = StringRegExpReplace($sString, "(?U)(<.*>)", "") ConsoleWrite($sStripped & @CRLF) Decode: (?U) - Not greedy - look for smallest match (<.*>) - Look for anything between <> "" - Replace any found strings with an empty string All clear? M231 point