Leaderboard
Popular Content
Showing content with the highest reputation on 02/24/2023 in all areas
-
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 😃2 points
-
AppData\Local\VirtualStore ??
Porygon and one other reacted to francoiste for a topic
that's "UAC Virtualization" available on windows OS. intended to make old crappy software (that doesn't care about restricted permissions) still work. it may kick in for certain folders in the file system and locations in the registry. this feature can lead to many problems. especially on multi-user environments. i strongly recommend to turn that feature OFF: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] "EnableVirtualization"=dword:00000000 the above registry switch does not disable UAC. it disables the "virtualization fake" (the file and registry redirection to some personal VirtualStore), only.2 points -
Switcher
SevenScript reacted to ioa747 for a topic
No I didn't change the icons i change the start status in line 6 $Enabled = True and then call Enabled() which means that it starts off and you have to press esc to be activated PS If you don't want it and you want to start activated just comment the line 6 to ; $Enabled = True1 point -
1 point
-
Switcher
SevenScript reacted to ioa747 for a topic
That was the point of stopping with Esc, that's what i understood try this version with one switch If it works for you ESC = on/off Func Enabled() If $Enabled = True Then TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico") $Enabled = False $SleepTime = 1000 ;~ HotKeySet("1") Else TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico") $Enabled = True $SleepTime = 10 HotKeySet("{ESC}", "Enabled") ;~ HotKeySet("1", "start") start() EndIf EndFunc ;==>Enabled1 point -
what is the -w- 7 parameters in AutoIt3Wrapper ?
SOLVE-SMART reacted to ioa747 for a topic
I just found out, the '-' it cancel the parameter which means that in the following it does nothing the the -w- 4 and the -w- 7 #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 informational only1 point -
Give us Capabilities dump from non compiled and compiled version. Focus on 32/64 bitness issues especially on: Local $sDriverPath = @ScriptDir & "\bin\" If @OSArch = "X64" Or @OSArch = "IA64" Then $sDriverPath &= "msedgedriver_win64.exe" ElseIf @OSArch = "X86" Then $sDriverPath &= "msedgedriver_win32.exe" EndIf and try to force 32/64 bit AutoIt for both compilled not compiled version with: #AutoIt3Wrapper_UseX64=N Check each scenario.1 point
-
Another AutoIt extension for Visual Studio Code
genius257 reacted to SOLVE-SMART for a topic
Hi @genius257, thank you very much 👍 . I will evaluate your extension during the next days/weeks, I guess I will have a deeper look to do a good comparison between the extension of "Damien" (which is extented and maintained by @LoganCH) and yours. I am very excited and grateful @genius257 😊 . Best regards Sven1 point -
try this to see if everything is in its expected position, maybe you can draw a conclusion ;Get DeskTop size Local $DTs = WinGetPos("[CLASS:Shell_TrayWnd]") ConsoleWrite("TaskBar:" & @CRLF & "X=" & $DTs[0] & " Y=" & $DTs[1] & " W=" & $DTs[2] & " H=" & $DTs[3] & @CRLF & @CRLF) ConsoleWrite("DeskTop:" & @CRLF & "Width:" & $DTs[2] & " Height:" & $DTs[1] + $DTs[3] & @CRLF) ;~ TaskBar: ;~ X=0 Y=1040 W=1920 H=40 ;~ ; ;~ DeskTop: ;~ Width:1920 Height:10801 point
-
Function "Execute" fails to execute string from STDIN in console mode
ioa747 reacted to mistersquirrle for a topic
I think similar to Part of the problem is how the 'Console' works in an uncompiled script. You're running it through the AutoIt.exe process, not through SciTE or its own process. You're not inputting into the 'correct' console window, is basically my thought. So, basically, you cannot do what you want unless you compile the script, and do you things from the console window of the direct .exe file. As for why Execute is not working, that's because of CR/LF/CRLF, basically. I tested your code, and some example code built from the help file entry for Execute, and I got it working: #include <MsgBoxConstants.au3> #cs Compile this script to "ConsoleRead.exe". Open a command prompt to the directory where ConsoleRead.exe resides. Type the following on the command line: echo Hello! | ConsoleRead.exe When invoked in a console window, the above command echos the text "Hello!" but instead of displaying it, the | tells the console to pipe it to the STDIN stream of the ConsoleRead.exe process. #ce ; MouseClick("main", 436, 451, 1, 10) ; Copy this and try executing that, or whatever you want Example() Func Example() If Not @Compiled Then MsgBox($MB_SYSTEMMODAL, "", "This script must be compiled in order to run the example.") Exit EndIf Local $sOutput While True Sleep(25) $sOutput = ConsoleRead() ;~ If @error Then ExitLoop If $sOutput <> '' Then MsgBox($MB_SYSTEMMODAL, "", "Received: " & @CRLF & 'Type: ' & VarGetType($sOutput) & @CRLF & $sOutput) Execute(StringStripCR(StringStripWS($sOutput, 1 + 2))) ; $STR_STRIPLEADING + $STR_STRIPTRAILING If @error Then MsgBox($MB_SYSTEMMODAL, "", "Execute $sOutput error: " & @CRLF & @CRLF & @error) EndIf EndIf WEnd MsgBox($MB_SYSTEMMODAL, "", "Received: " & @CRLF & @CRLF & $sOutput) EndFunc ;==>Example Give that a shot (compiled) and see if it works for you, it did for me (sending the MouseClick line in there). Keep in mind then that this will only work for single line things. Edit: Also take a look at https://www.autoitscript.com/autoit3/docs/intro/running.htm, specifically: AutoIt specific command Line Switches And keep in mind that to use AutoIt3ExecuteScript or AutoIt3ExecuteLine, the file needs to be compiled with this flag: #pragma compile(AutoItExecuteAllowed, true)1 point -
Function starting function
SevenScript reacted to argumentum for a topic
..you could change the logic by setting a Global $iActive and run it from the main loop1 point -
is it possible the get the mouse moving speed and return its speed value?
jacky998877 reacted to mistersquirrle for a topic
Yes, it's possible. Have you tried anything? It's some basic mathematics. Calculate the distance between 2 measurements of the cursor, use a timer to get how long it was between measurements, and then calculate the speed using the distance and time taken (speed = distance/time).1 point -
Function starting function
SevenScript reacted to mistersquirrle for a topic
First of all, Send can trigger HotKeys, so I strongly recommend that you don't set hotkeys that are likely to be in data that you're Send'ing. So use a key like {HOME}, {F1}, etc. Your {down} and {up} will get triggered by your Sends, and you'll have no idea what state your script is in. I get that this seems to be the only way that you're familiar with how to call a function, but it's just a very poor way to do it. HotKeySet should only be used for user interaction. Secondly, for your first question, I strongly recommend that you read a tutorial on using AutoIt, since what you're asking for is very basic: https://www.autoitscript.com/wiki/Tutorials But to show you an example: Func1() Func Func1() Local $sFunc2Msg = Func2() MsgBox(0, 'Func1', 'Message from Func2 after being called from Func1: ' & @CRLF & @TAB & $sFunc2Msg, 10) EndFunc ;==>Func1 Func Func2() Local $sMsg = 'This is Func2, reporting in' MsgBox(0, 'Func2', $sMsg, 5) Return $sMsg EndFunc ;==>Func2 Exit I believe that the functionality that you're after (doing a different thing each time you press the button) is what I put in my post on your other topic here: If that's not what you're looking for it, it would be good to explain what you want to do, ignoring anything that you've currently tried (give us the idea). Are you looking for something like this, where each time you press NumLock this happens: Send('2') Send('w') continuously until you press NumLock again: Send('4') Then repeat?1 point -
Decibel, Thanks for that report - I am amazed no-one has discovered that problem before now! I have added a rider to the line which mentions those constants explaining that StaticConstants.au3 must be included if they are to be used. M231 point
-
Change titlebar colors of AutoIt gui
taurus905 reacted to SOLVE-SMART for a topic
Thanks @taurus905, I appreciate that you noticed this 😀 . For me it's almost all about readability and quick understanding of code even if I have to write more code (more functions). Anyway, thanks 🤝 . 😊 At least I try so and do my best. Best regards Sven1 point -
Change titlebar colors of AutoIt gui
taurus905 reacted to SOLVE-SMART for a topic
There seems to be many way to achieve something like you're looking for, thanks to this nice and experienced community 👍 . Nevertheless I want to show you @taurus905 a quick example of a custom title bar which I created out of GUI snippets that I used in other projects before. 💡 Please keep in mind, I usually would modularize the code into separate files (depending on the duties), but in this case I just did it in a single script file. #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_Run_Au3Stripper=y #AutoIt3Wrapper_UseUpx=n #Au3Stripper_Parameters=/sf /sv /mo /rm /rsln #include-once #include <GUIConstants.au3> #include <Misc.au3> Global $mGui[], $mTitleBar[] Global $mClosingCrossIcon[], $mMinimizeIcon[] Global $mTitleBarColor[] $mTitleBarColor.background = 0xD9534F $mTitleBarColor.font = 0xFBEDED $mTitleBarColor.faviconIcon = $GUI_BKCOLOR_TRANSPARENT $mTitleBarColor.hoverMinimize = 0xE5E5E5 $mTitleBarColor.hoverClose = 0xE81123 _Actions() Func _Actions() _CreateGui() _CreateTitleBar() _AddTitleBarButtons() _ShowGui() _GuiEventListener() EndFunc Func _CreateGui() $mGui.Width = 600 $mGui.Height = 350 $mGui.Style = $WS_POPUP $mGui.Handle = GUICreate('', $mGui.Width, $mGui.Height, Default, Default, $mGui.Style) EndFunc Func _CreateTitleBar() ; background $mTitleBar.X = 0 $mTitleBar.Y = 0 $mTitleBar.W = ($mGui.Width - 137) $mTitleBar.H = 26 $mTitleBar.ButtonWidth = 25 $mTitleBar.ButtonHeight = $mTitleBar.ButtonWidth $mTitleBar.cId = GUICtrlCreateLabel('', $mTitleBar.X, $mTitleBar.Y, $mTitleBar.W, $mTitleBar.H) GUICtrlSetBkColor($mTitleBar.cId, $mTitleBarColor.background) GUICtrlSetStyle($mTitleBar.cId, -1, $GUI_WS_EX_PARENTDRAG) ; favicon icon GUICtrlCreateLabel('🎲', 4, 5.5) ; I used the cube icon as example which can be pasted in by pressing [WIN] + [.] GUICtrlSetBkColor(-1, $mTitleBarColor.faviconIcon) GUICtrlSetFont(-1, 11) ; title GUICtrlCreateLabel('GUI with custom title bar', 24, 5.5, ($mGui.Width / 2)) GUICtrlSetColor(-1, $mTitleBarColor.font) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1, 9) EndFunc Func _AddTitleBarButtons() _AddClosingCrossIcon() _AddMaximizeIcon() _AddMinimizeIcon() EndFunc Func _AddClosingCrossIcon() ; background $mClosingCrossIcon.X = ($mGui.Width - 45) $mClosingCrossIcon.Y = 0 $mClosingCrossIcon.W = $mTitleBar.ButtonWidth + 20 $mClosingCrossIcon.H = $mTitleBar.ButtonHeight + 1 $mClosingCrossIcon.cId = GUICtrlCreateLabel('', $mClosingCrossIcon.X, $mClosingCrossIcon.Y, $mClosingCrossIcon.W, $mClosingCrossIcon.H) GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.background) ; icon GUICtrlCreateLabel(ChrW(0xCD), ($mGui.Width - 31), 5.5, $mTitleBar.ButtonWidth, $mTitleBar.ButtonHeight) GUICtrlSetFont(-1, 14, 100, Default, 'Wingdings 2') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) EndFunc Func _AddMaximizeIcon() ; background GUICtrlCreateLabel('', ($mGui.Width - 92), 0, $mTitleBar.ButtonWidth + 22, $mTitleBar.ButtonHeight + 1) GUICtrlSetBkColor(-1, $mTitleBarColor.background) ; icon GUICtrlCreateLabel(ChrW(0xA3), ($mGui.Width - 75), 6.5, $mTitleBar.ButtonWidth, $mTitleBar.ButtonHeight) GUICtrlSetFont(-1, 11, 100, Default, 'Wingdings 2') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xCCCCCC) EndFunc Func _AddMinimizeIcon() ; background $mMinimizeIcon.X = ($mGui.Width - 137) $mMinimizeIcon.Y = 0 $mMinimizeIcon.W = $mTitleBar.ButtonWidth + 20 $mMinimizeIcon.H = $mTitleBar.ButtonHeight + 1 $mMinimizeIcon.cId = GUICtrlCreateLabel('', $mMinimizeIcon.X, $mMinimizeIcon.Y, $mMinimizeIcon.W, $mMinimizeIcon.H) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.background) ; icon GUICtrlCreateLabel(ChrW(0x2015), ($mGui.Width - 119), 6.5, $mTitleBar.ButtonWidth, $mTitleBar.ButtonHeight) GUICtrlSetFont(-1, 8, 100, Default, 'Segoe UI') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) EndFunc Func _ShowGui() GUISetState(@SW_SHOW, $mGui.Handle) EndFunc Func _GuiEventListener() AdlibRegister('_HoverActions', 100) Local Const $iGuiEventClose = -3 While True Switch GUIGetMsg() Case $iGuiEventClose, $mClosingCrossIcon.cId ExitLoop Case $mMinimizeIcon.cId GUISetState(@SW_MINIMIZE, $mGui.Handle) EndSwitch WEnd _GuiDisposeAndExit() EndFunc Func _GuiDisposeAndExit() AdlibUnRegister('_HoverActions') GUIDelete($mGui.Handle) Exit EndFunc Func _HoverActions() Local $aMouseData = MouseGetPos() Local $aGuiData = WinGetPos($mGui.Handle) If Not _HoverTitleBar($aMouseData, $aGuiData) Then _ResetHoverColor() Return EndIf Select Case _HoverMinimizeIcon($aMouseData, $aGuiData) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.hoverMinimize) GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.background) Case _HoverClosingCrossIcon($aMouseData, $aGuiData) GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.hoverClose) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.background) Case Else _ResetHoverColor() EndSelect EndFunc Func _ResetHoverColor() GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.background) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.background) EndFunc Func _HoverTitleBar($aMouseData, $aGuiData) Return _IsMouseOnControl( _ $aMouseData[0] - $aGuiData[0], _ $aMouseData[1] - $aGuiData[1], _ $mTitleBar.X, $mTitleBar.Y, $mGui.Width, $mTitleBar.H) EndFunc Func _HoverMinimizeIcon($aMouseData, $aGuiData) Return _IsMouseOnControl( _ $aMouseData[0] - $aGuiData[0], _ $aMouseData[1] - $aGuiData[1], _ $mMinimizeIcon.X, $mMinimizeIcon.Y, $mMinimizeIcon.W, $mMinimizeIcon.H) EndFunc Func _HoverClosingCrossIcon($aMouseData, $aGuiData) Return _IsMouseOnControl( _ $aMouseData[0] - $aGuiData[0], _ $aMouseData[1] - $aGuiData[1], _ $mClosingCrossIcon.X, $mClosingCrossIcon.Y, $mClosingCrossIcon.W, $mClosingCrossIcon.H) EndFunc Func _IsMouseOnControl($iXMouse, $iYMouse, $iXControl, $iYControl, $iWidthControl, $iHeightControl) If $iXMouse >= $iXControl And _ $iYMouse >= $iYControl And _ $iXMouse <= $iXControl + $iWidthControl And _ $iYMouse <= $iYControl + $iHeightControl Then Return True Else Return False EndIf EndFunc It was more complex than I thought, but as a proof of concept I enjoyed it 😅 . Please notice that you can minimize or close the GUI like you would expect it. Also the GUI is draggable by the title bar. 👓 Open the spoiler box to see the example: Best regards Sven1 point -
Regex: get only nth match not all
pixelsearch reacted to jchd for a topic
I never worked on the French help file but as I look at it, it seems a fair translation of my english version.1 point -
font setting GUISetFont
pixelsearch reacted to Melba23 for a topic
Shark007, I would suggest that you need just the integer value - most of the constants we use in AutoIt are defined in the relevant *Constants.au3 include and begin with a $-sign. As the example in the Help file does not, I would draw the conclusion that there is no such constant value defined. This little snippet will let you see the default GUI font of the machine it is run on: #include <WinAPI.au3> $hLogFont = _WinAPI_GetStockObject($DEFAULT_GUI_FONT) $structLF = DllStructCreate($tagLogFont) $isize = _WinAPI_GetObject($hLogFont, 0, 0) $iWritten = _WinAPI_GetObject($hLogFont, $isize, DllStructGetPtr($structLF)) $output = "Height = " & DllStructGetData($structLF, 1) & @CRLF $output &= "Width = " & DllStructGetData($structLF, 2) & @CRLF $output &= "Escapement = " & DllStructGetData($structLF, 3) & @CRLF $output &= "Orientation = " & DllStructGetData($structLF, 4) & @CRLF $output &= "Weight = " & DllStructGetData($structLF, 5) & @CRLF $output &= "Italic = " & DllStructGetData($structLF, 6) & @CRLF $output &= "Underline = " & DllStructGetData($structLF, 7) & @CRLF $output &= "StrikeOut = " & DllStructGetData($structLF, 8) & @CRLF $output &= "CharSet = " & DllStructGetData($structLF, 9) & @CRLF $output &= "OutPrecision = " & DllStructGetData($structLF, 10) & @CRLF $output &= "ClipPrecision = " & DllStructGetData($structLF, 11) & @CRLF $output &= "Quality = " & DllStructGetData($structLF, 12) & @CRLF ; <<<<<<<<<<<<<<<<<<<<<<<<<<<< I get 0 here and my GUIs are perfectly readable $output &= "PitchAndFamily = " & DllStructGetData($structLF, 13) & @CRLF $output &= "FaceName = " & DllStructGetData($structLF, 14) & @CRLF MsgBox(0, "", $output)I must say that I have never seen the "quality" parameter used in an AutoIt script - do you find it absolutely necessary? What problem are you trying to solve by using it? And if it is this parameter which is causing the problem, and omitting it makes everything run smoothly, is the quality really a significant issue? Your script - your decision, of course! M231 point -
Switcher
SevenScript reacted to ioa747 for a topic
try it This is the correct order, the functions go down #include <misc.au3> Local $Enabled, $SleepTime Enabled() ;************************************************ While 1 Sleep($SleepTime) WEnd ;************************************************ Exit ;---------------------------------------------------------------------------------------- Func start() ; While $Enabled Sleep(10) If _IsPressed("90") Then ; 90 NUM LOCK key ;~ ConsoleWrite(":") Sleep(50) Send("Its") Sleep(200) Send("a simply") Sleep(200) Send("text") Sleep(150) EndIf WEnd EndFunc ;==>start ;---------------------------------------------------------------------------------------- Func Enabled() If $Enabled = True Then TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico") $Enabled = False $SleepTime = 1000 Else TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico") $Enabled = True $SleepTime = 10 HotKeySet("{ESC}", "Enabled") start() EndIf EndFunc ;==>Enabled0 points