Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/31/2022 in all areas

  1. RTFC

    Code Scanner

    You're not going wrong, I was. CodeScanner was the second AutoIt script I ever wrote, and the first one I ever released (I wrote it to trace/resolve a deeply-nested callstack bug in my first script I just couldn't seem to fix manually; that now seems like a lifetime ago). It's almost a decade old and filled with patches of patches of rookie design mistakes (such as separate, parallel explicit lists of files to process for different cases, which then diverged, which causes "AU3operators.txt" to be written out for MCF processing, but not when writing a full dump). I never noticed this before, so thank you for spotting this. I should really spend some time to overhaul that whole data dump disaster and make it streamlined and consistent for a change. In the meantime, a quick patch would be in CodeScanner's function _WriteCSDataDump, immediately under label "; dump 1-D arrays" to just duplicate line: "_FileWriteFromArray1D($CS_dumppath & "AU3Functions.txt",$AU3Functions,1)" and edit it to write out the operators too: _FileWriteFromArray1D($CS_dumppath & "AU3operators.txt",$AU3operators,1) Since it always exists, there's no need to check for existence and optionally add an empty dummy file afterwards (immediately below that section). Hint: Instead of using CodeCrypter (which is just a front-end for the MCF library), I would suggest you engage with the latter directly (as intimated earlier), like so: #include "MCF.au3" Global $path="<your CS_DATA dump path, including trailing backslash \>" If _ReadCSDataDump($path)=False Then Exit(-11) If Not FileExists($path & "MCF0.au3") Then If _CreateSingleBuild($path,True)=False Then Exit(-12) EndIf If _PhraseMCF($path)=False Then Exit(-13) ConsoleWrite("Done." & @CRLF) Easier, no?
    1 point
  2. Gianni

    Code Scanner

    Hi @RTFC, Thank you for your answer, I was able to generate the loops.txt file, but not the MCF0_phrased.txt file Could you please detail the steps required to generate the MCF0_phrased.txt file as well? I added #include "MCFinclude.au3" at the beginning of my Simplest.au3 target file I checked that the WriteMetaCode=True entry is present in the CodeScanner.ini file I forced the True parameter in the _WriteCSDataDump(True) function present in the _AnalyseCode() portion of the CodeScanner.au3 listing so running CodeScanner.au3, this also generated the loops.txt file Running codecrypter.au3 later I get this alert: "CodeScanner output file not found: \....\Simplest.au3.CS_DATA\AU3operators.txt Are you sure you ran CodeScanner with setting "WriteMetaCode=True", on target file \....\simplest.au3 before? CodeCrypter requires this function." the process proceeds anyway, but at the end I can't find the MCF0_phrased.txt file Where am I doing wrong? Thanks again for any help
    1 point
  3. kurtykurtyboy

    AutoIt Snippets

    Here are 2 ways to move a ridiculous amount of GUI controls at once. This could easily be extended to resize at the same time. ;stop window from redrawing, set control positions, allow and redraw the window Func _CtrlsSetPos($hGUI, ByRef $aCtrls, $offsetX = 0, $offsetY = 0) Local $aCurrentPos _SendMessage($hGUI, $WM_SETREDRAW, False) For $i = 0 To UBound($aCtrls) - 1 $aCurrentPos = ControlGetPos(GUICtrlGetHandle($aCtrls[$i]), "", 0) GUICtrlSetPos($aCtrls[$i], $aCurrentPos[0] + $offsetX, $aCurrentPos[1] + $offsetY) Next _SendMessage($hGUI, $WM_SETREDRAW, True) _WinAPI_RedrawWindow($hGUI) EndFunc ;==>_CtrlsSetPos ;move many GUI controls at the same time using Windows' DeferWindowPos structure Func _DeferWindowPos(ByRef $aCtrls, $offsetX = 0, $offsetY = 0) Local $aCurrentPos Local $hDeferWindowPos = _WinAPI_BeginDeferWindowPos(UBound($aCtrls)) For $i = 0 To UBound($aCtrls) - 1 $aCurrentPos = ControlGetPos(GUICtrlGetHandle($aCtrls[$i]), "", 0) _WinAPI_DeferWindowPos($hDeferWindowPos, GUICtrlGetHandle($aCtrls[$i]), Null, $aCurrentPos[0] + $offsetX, $aCurrentPos[1] + $offsetY, 0, 0, $SWP_NOZORDER + $SWP_NOSIZE) Next _WinAPI_EndDeferWindowPos($hDeferWindowPos) EndFunc ;==>_DeferWindowPos
    1 point
  4. Ah, you're right. Don't I feel silly now! I guess I was thinking 1,000ms in 1sec, so 4 digits. 🤦‍♂️ I'll go ahead and fix that... Fixed!
    1 point
  5. trancexx

    Access AutoIt

    Majority of users of AutoIt language likes it because it's easy to learn and very powerful when it comes to automating some basically very complicated stuff on windows. AutoIt often does it in just one line of code while doing it in other languages would be writing a full book of code. How to use AutoIt with other languages? One way would be to use AutoItX. Dll version of AutoIt. In this case you can access it through COM or exported functions. Downside surely is limited number of available functions and user rights for COM option. Other way is... no wait, there is no other way. But, what If I add some magic salt to the soup? Let's say I use some of the code from (thanks Manadar) and, yes you guessed AutoItObject, and make a simple (the most basic) COM server that exports almost the whole AutoIt functionality to anyone wanting to use it. AutoItObject 1.2.8.0 makes objects published to ROT (running object table) more accessible than ever. Accessing the object is as easy as GetObject(...) in any scripting language and CoGetObject() through Windows API. An example of VBS would be: Javascript could be: C# PowerShell (based on ptrex's example) Python (AdmiralAlkex) ...and so on. Server script is really minimalistic: All packed in ZIP: AccessAutoIt.zip What you'll find there is folder named AccessAutoIt. Unzip it somewhere and inside there will be five files: AutoItObject.au3 (1.2.8.0), AutoItServer.au3, Csharp.cs, JS.js and VBS.vbs. Run AutoItServer.au3 and then either vbs or js script or compile Csharp.cs and run resulting executable. I have chosen AutoIt.Application object moniker for no particular reason. Can be anything. Latest AutoItObject, if you want the whole thing, is here. AutoIt on your palm. edit: Added c# example. Don't mind about my usage of other languages. I'm not quite familiar with them.
    1 point
×
×
  • Create New...