Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2024 in all areas

  1. So another vscode extension for the AutoIt language emerges! I've tried the existing ones, and found small problems that i felt i could improve on, but it would require an entire new approach to the inner working of the existing extensions. Also working on a complete AutoIt3 parser a vscode extension just made sense Any feedback is appreciated, and i hope this project will benefit more than just me 🤡 Visual Studio Code Marketplace GitHub repo Some of the current features: Basic AutoIt2 syntax highlighting, for fun 🤡 AutoIt3 syntax highlighting Variable/Function hover gives declaration information if available. Goto declaration #include links Syntax checking, as you type Function signature help Function and variable list in a file via the outline tab. Works on desktop (any OS) and web version ⚠️ The parser used is not yet 100% complete (see issues for know problems), and the last thing to be implemented is the With code block. Hope you like 😃
    1 point
  2. Hello everybody I'm a total newbie to Maps in AutoIt. Instead, I used a few times the similar Scripting.Dictionary object (which is damn fast) . Maybe the advantage of Maps could be that, if one day MS removes the Scripting.Dictionary object (I doubt it but who knows...) then we'll be happy that Maps exist in recent versions of AutoIt. Anyway, I just started to learn Maps and needed to display at same time the Keys & their corresponding Values. So I scripted this simple reusable function which seems to do the job and is called by one line : _ArrayDisplay(_Map2D($mMap), "Map Keys & Values") Here is the functional example corresponding to the pic : ; AutoIt 3.3.16.1 (Map) #include <Array.au3> local $mMap[] $mMap["Beethoven"] = "Bee" $mMap["Berlioz"] = "Ber" $mMap["Chopin"] = Null ; create a key "Chopin" without assigning it a value _ArrayDisplay(_Map2D($mMap), "Map Keys & Values") Func _Map2D(Const ByRef $mMap) Local $aMapKeys = MapKeys($mMap) Local $aMap2D[Ubound($aMapKeys)][2] Local $iRow = - 1 For $vKey In $aMapKeys ; or a simple For... loop as commented out below $iRow += 1 ; 0+ $aMap2D[$iRow][0] = $vKey $aMap2D[$iRow][1] = $mMap[$vKey] Next ;~ For $i = 0 To Ubound($aMapKeys) - 1 ;~ $aMap2D[$i][0] = $aMapKeys[$i] ;~ $aMap2D[$i][1] = $mMap[$aMapKeys[$i]] ;~ Next Return $aMap2D EndFunc I just tested it on 10.000 pairs of key/values created by using the code below and the return from the function was immediate : For $i = 0 To 9999 $mMap[$i] = $i + 10 Next If you guys got some improvements for the function, please share them here, thanks.
    1 point
  3. Do you guys get the same issue that I am getting with @ioa747 code. 1- Move one label to another location 2- Minimize the GUI 3- Restore the GUI The one label that was moved now has disappeared ! Even if the GUI was redrawn... Edit : found the problem, replace last : ControlMove($hGUI, '', $aLabel[$i][0], Default, $aLabel[$i][1]) with GUICtrlSetPos($aLabel[$i][0], $iLeft, $aLabel[$i][1]) Seems that ControlMove does not inform the GUI of the new position of the controls
    1 point
  4. ioa747, Thank you so much for assisting me with this challenging task! Personally, I wasn't able to figure it out on my own.
    1 point
  5. This looks good for me. #include <ScreenCapture.au3> ; https://mozjpeg.codelove.de/binaries.html ; https://mozjpeg.codelove.de/bin/mozjpeg_3.1_x86.zip ; Requires "cjpeg.exe" and "libjpeg-62.dll" in @ScriptDir _ScreenCapture_Capture(@ScriptDir & "\screen.bmp") Run(@ComSpec & " /c cjpeg.exe -quality 92 -rgb screen.bmp > screen.jpg", @ScriptDir, @SW_HIDE) cjpeg_screenshot.zip
    1 point
  6. It seems that there are no issues using Scripting.Dictionary #include <Array.au3> Local $a[11] = [1, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12] Local $b[12] = [1, 2, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14] Local $sda = ObjCreate("Scripting.Dictionary") Local $sdb = ObjCreate("Scripting.Dictionary") Local $sdc = ObjCreate("Scripting.Dictionary") For $i In $a $sda.Item($i) Next For $i In $b $sdb.Item($i) Next For $i In $a If $sdb.Exists($i) Then $sdc.Item($i) Next $asd3 = $sdc.Keys() For $i In $asd3 If $sda.Exists($i) Then $sda.Remove($i) If $sdb.Exists($i) Then $sdb.Remove($i) Next $asd1 = $sda.Keys() $asd2 = $sdb.Keys() _ArrayDisplay($asd1, "$asd1") _ArrayDisplay($asd2, "$asd2") _ArrayDisplay($asd3, "$asd3")
    1 point
×
×
  • Create New...