Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/11/2025 in all areas

  1. Good morning, I would love to contribute to either of the extensions. As I mentioned, I have been using VSCode with the Damian/Loganch extension for quite some time, and having the "Problems" tab really speeds up development. What do I love about the genius257 extension? IntelliSense is context-aware. So, if I am typing a variable, it lists everything that is valid in the current context. Combining the best features of both extensions would be amazing!
    2 points
  2. Am using both. Why, how, ..even added a "genius257.autoit3-debug". What am I doing ?, ..just F5 ( to run ) and clicking around. I tend to learn that way ..20 minutes later.. ok, I see that Damian has ">AutoIt: command" and if I remove it that's not there. I'll play around a bit more
    2 points
  3. Glad you found a solution. If you feel like donating, Just send it to AutoIt.
    2 points
  4. Yes, I ended up removing the Do loop when I realised the same, it was useful to increase accuracy for previous versions of the script that would return nothing when nothing was recognised, but since these latest versions seem to fallback to returning 0000 or 1111 for unrecognised numbers it's no longer necessary. Thanks for the optimisation tips, I knew writing to the file each time was slow but didn't know of a better way to do it, I'll convert it to use an array instead.
    1 point
  5. I would also recommend writing the results to an array and then just use FileWriteFromArray() once after the loop, you are filewriting a million times as it is now, which may be a major bottleneck. This is NOT tested, just to give an idea. $hDDC = _WinAPI_GetDC(0) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBmp = _WinAPI_CreateCompatibleBitmap($hDDC, 88, 32) _WinAPI_SelectObject($hCDC, $hBmp) Local $Array[1000000] For $loop = 0 To 999999 $serial = StringFormat('%06i', $loop) ControlClick($tool, "", "TTabSheet1", "primary", 1, 100, 100) _WinAPI_BitBlt($hCDC, 0, 0, 88, 32, $hDDC, $posx, $posy, 0x00CC0020) $Array[$loop] = GetNumber($result); you probably need to add the serial here also Next _WinAPI_DeleteDC($hCDC) _FileWriteFromArray($db, $Array)
    1 point
  6. Thanks for the nice words, glad you liked it, you can donate to AutoIt I noticed in the script you posted that you call these 5 lines a million times, you only need to call them once, bitblt just reuses them, so place them outside the loop... $hDDC = _WinAPI_GetDC(0) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBmp = _WinAPI_CreateCompatibleBitmap($hDDC, 88, 32) _WinAPI_SelectObject($hCDC, $hBmp) _WinAPI_DeleteDC($hCDC) $hDDC = _WinAPI_GetDC(0) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBmp = _WinAPI_CreateCompatibleBitmap($hDDC, 88, 32) _WinAPI_SelectObject($hCDC, $hBmp) For $loop = 0 To 999999 Do $serial = StringFormat('%06i', $loop) ControlClick($tool, "", "TTabSheet1", "primary", 1, 100, 100) _WinAPI_BitBlt($hCDC, 0, 0, 88, 32, $hDDC, $posx, $posy, 0x00CC0020) $result = GetNumber($result) Until ((StringLen($result) = 4) and StringIsDigit($result)) FileWrite($db, $serial & "," & $result & @LF) Next _WinAPI_DeleteDC($hCDC) That should speed things up a bit. Also, what is the reason for the Do-Until, getnumber($result) always returns 4 digits so I dont see a need to wait for them or check if they are digits, they always are, so your loop should/could look something like this... $hDDC = _WinAPI_GetDC(0) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBmp = _WinAPI_CreateCompatibleBitmap($hDDC, 88, 32) _WinAPI_SelectObject($hCDC, $hBmp) For $loop = 0 To 999999 $serial = StringFormat('%06i', $loop) ControlClick($tool, "", "TTabSheet1", "primary", 1, 100, 100) _WinAPI_BitBlt($hCDC, 0, 0, 88, 32, $hDDC, $posx, $posy, 0x00CC0020) $result = GetNumber($result) FileWrite($db, $serial & "," & $result & @LF) Next _WinAPI_DeleteDC($hCDC) Dont know if I'm overlooking something.
    1 point
  7. Damnatio

    Run binary

    Okay, I just took a "deeper" look into the ntdll and compared two version (2894 and 3037). In both versions is an exported function called "RtlEqualUnicodeString" 0x310 bytes away from "RtlpInsertOrRemoveScpCfgFunctionTable". So to make your code work dynamic with older and newest build of 24H2 you can simply grab the offset of "RtlEqualUnicodeString" by using _WinAPI_GetProcAddress and then add 0x310 bytes to that offset. Like this: #Region 12 FIX NTDLL for Win11 24H2 $WinVer = RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DisplayVersion") If $WinVer = "24H2" Then $ntdllbase = _WinAPI_GetModuleHandle("ntdll.dll") $ZwManageHotPatch = _WinAPI_GetProcAddress($ntdllbase, "ZwManageHotPatch") $RtlEqualUnicodeString = _WinAPI_GetProcAddress($ntdllbase, "RtlEqualUnicodeString") $RtlpInsertOrRemoveScpCfgFunctionTable = $RtlEqualUnicodeString + 0x310 $bPatch = 0xC3C03148 $pBuf = DllStructCreate("byte[4]") DllStructSetData($pBuf, 1, $bPatch) $aCall = DllCall("kernel32.dll", "bool", _RunBinary_LeanAndMean(), _ "handle", $hProcess, _ "ptr", $ZwManageHotPatch, _ "ptr", DllStructGetPtr($pBuf), _ "dword_ptr", DllStructGetSize($pBuf), _ "dword_ptr*", 0) ; Check for errors or failure If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hProcess, "dword", 0) Return SetError(12, 0, 0) ; failure while changing ntdll EndIf $aCall = DllCall("kernel32.dll", "bool", _RunBinary_LeanAndMean(), _ "handle", $hProcess, _ "ptr", $RtlpInsertOrRemoveScpCfgFunctionTable, _ "ptr", DllStructGetPtr($pBuf), _ "dword_ptr", DllStructGetSize($pBuf), _ "dword_ptr*", 0) ; Check for errors or failure If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hProcess, "dword", 0) Return SetError(12, 0, 0) ; failure while changing ntdll EndIf EndIf #EndRegion 12 FIX NTDLL for Win11 24H2
    1 point
  8. So I'm assuming that you are using Damien.autoit, because my extension does not have the trace add functionality. As for double clicking in vscode, i suspect you want to use ctrl+click or right click and choose "Go to Definition" (you can also use F12 to goto definition if your caret is on a function call or variable)
    1 point
  9. In general I mean the scripts one would put in the "PersonalTools.lua" script (found in C:\Users\Name\AppData\Local\AutoIt v3\SciTE), and assign a hotkey for in SciTEUser.properties, to call in Scite. Generally where you are able to tie into the editor, get the current selected word, etc. Specifically, for one, I have a tool that scans a script for func declarations and lists each func name in a specific spot at the top, in the order found (For UDF header lists). Thanks for the suggestions.
    1 point
  10. I'm not familiar with what kind of custom LUA scripts you're referring to, but i really depends on the task required. The solutions could be one or a combination of: vscode features, existing extensions, external CLI tools or you own custom extension.
    1 point
  11. Just checked the latest LUA code I posted in the previous available SciTE5-with-DynamicFunctions directory, and there are no changes with the current Beta installer in the AutoItTools.lua file (other that the comment changes I have reverted. So could it be that this is an oops that is made longer ago? EDIT: I will merge it back in and this time in the proper version of AutoItTools.lua and put in the next version of the installer before release. EDIT2: Merged your changes again into AutoItTools.lua and created an updated Beta installer v25.205.1420.1. It only contains changes for SciTE: Merged the Header changes from you Updated The scanning through the *.au3 in the Dynamic LUA code so it can handle filenames containing a special character. Changed AutoitWrapper to avoid getting a Set HotKeys error in case they are set to Blank. Jos
    1 point
  12. Hi all, I just wanted to write about the current WIP release and future extension plans. For the 1.8 release: For anyone interested in the new DocBlock format, I've implemented support for @link tags, both as a stand alone tag and inline tag. I also plan to implement syntax highlighting for both DockBlock format and the legacy UDF format. I've been busy working on issues with the parser and auto-generated typescript types. This is, and my AutoIt3 parser in AutoIt3 project are the reason for the slow release of 1.8. When i resolve the last issues with type generation, i will finish and release 1.8! 🙂 For future releases: The function signature helper for parameters in functions is currently too flaky for me, and i will spend time to try and improve the experience. I will look into partial code AST object updates with the parser. I am not 100% sure how well i will be able to implement it, but i hope to improve performance when working in big script files. I want to add a static typing to functions and variables. Type hinting or casting will be supported via a new comment syntax. Built-in functions and variables will be supported right away, when typing resolution is released. This should help with general development and allow warnings with for example, when doing implicit variable type casting via operators. I also want to implement a formatter/linter. For now, the plan is to add it to this extension, but may end up being it's own thing, depending on configuration complexity and performance overhead. Also, completion suggestions for DllStruct object members. DllStruct's (and maybe some COM objects) will be analyzed and allow completion suggestions and errors for use of non existing members. This MAY also include Map and Array objects, but it is unclear how easy it will be to infer size and members of those. And finally for now, syntax highlighting and attempted analysis of strings given to Eval, Execute and Assign. I cannot guarantee all will be implemented. Most will be exploratory implementations when the time comes, but hopefully it will result in the best editor experience i can offer!
    1 point
  13. Trong

    Image Search UDF

    Version 2021.8.30.2

    10,629 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.exe
    1 point
  14. Top of your script: $RunningTime = TimerInit() End of your script (before exit) MsgBox(0, "Running Time", TimerDiff($RunningTime)/1000&" seconds") You better start reading the Help file
    1 point
×
×
  • Create New...