

Firstly, I didn't see a forum section that was well suited for this article, so I decided to place it in the help section, since that would be the most read section. Feel free to move this article to the appropriate section.
If you're here at the forums, you understand that Autoit is a very powerful tool for controlling Windows.
You may also be aware of a tool that is included with Windows 7 called, "Windows Speech Recognition" which allows you to use voice commands to run tasks, like... Opening the start menu, or running a program.
What you may not be aware of is, "Windows Speech Recognition Macros" or "WSR Macros" for short.
This is a free program put out by Microsoft that lets you create your own voice commands. You would essentially... create a trigger word or phrase, then you have the option of what you want WSR to do when it hears that phrase.
While that sounds amazing, in practice it's very limited. This is where Autoit comes into play.
Using WSR Macros, you can set a voice command to run a program. Any program.
This allows for a very large array of amazing things that you can do using Autoit.
For example. I use PotPlayer for watching videos. If I say, "Pause" WSR has no clue what I'm talking about. But, creating a simple and very short program in Autoit.
Now I can tell WSR to run "Pause.exe" if I say, pause. (compiled from the au3)
Using this simple combination of programs, you can create any string of trigger words to do anything your imagination can think of.
Helpful Tips:
Using more than 1 word for the trigger will help WSR distinguish between if you are just talking or if you're giving a command. This will also help if you are transcribing, as not to run a command when your intention is to transcribe the word.
Because language is artistic, there can be several ways to complete the same action.
"Open my music folder"
"Let's listen to some music"
"Open my music"
To prevent a ton of file clutter, instead of selecting "New Speech Macro..." for every way you say things, select "Explore Speech Macros..." Then go to the original macro file (WSRMac extension) and alter the contents a bit.
Like this...
(Not incapsulated to maintain color for easier reading)
-----
<?xml version="1.0" encoding="UTF-16"?>
<speechMacros>
<command>
<listenFor>Open my music folder</listenFor>
<run command="C:\Music" params=""/>
</command>
<command>
<listenFor>Let's listen to some music</listenFor>
<run command="C:\Music" params=""/>
</command>
<command>
<listenFor>Open my music</listenFor>
<run command="C:\Music" params=""/>
</command>
<Signature>
encrypted coding, very long, useless to the purpose
-----
Notice... You don't need a seperate file, just add another command to the same file. If you really wanted to tidy up, you could actually merge all your different voice commands into 1 giant (and very confusing) file.
Hello all
I used this code for printing my pics but when use "$FD_MULTISELECT" , program show error
#include <File.au3> #include <MsgBoxConstants.au3> Local $sFilePath = FileOpenDialog("page", "p1\" , "pic(*.jpg)", $FD_FILEMUSTEXIST + $FD_MULTISELECT)
Can you help me?
If any error happens I want script to exit quietly without popup error message and script close automatically. Script is reading some data from files, sort database, performing some actions with IE, read Windows handle etc.
After some time if script is not running then other script restarting it.
There to much write to handle all the errors, need simple solution when scrip exits on any error.
I'm experimenting with GetPixel functions (in order to find the fastest) and have this simple part in my script:
Local $iWidth = 150 Local $iHeight = 300 Local $array[$iHeight][$iWidth] For $i = 1 To $iHeight Step 1 For $j = 1 To $iWidth Step 1 $array[$i-1][$j-1] = PixelGetColor($iHeight-1, $iWidth-1, $Handle) Next Next
Trying to get the equivalent using the GDI+ library (more specifically, using the _GDIPlus_BitmapLockBits function) I've got this code:
Global $Handle = WinGetHandle("Paint") Local $sWow64 = "" If @AutoItX64 Then $sWow64 = "\Wow6432Node" ; X64 running support ; Initialize GDI+ library _GDIPlus_Startup() ; Capture 32 bit bitmap to a HBITMAP WinActivate($Handle) Local $hBMP = _ScreenCapture_CaptureWnd("", $Handle) ; _ScreenCapture_CaptureWnd returns a handle to an HBITMAP if $sFileName is empty Local $pBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) Local $iWidth = 150 Local $iHeight = 300 Local $array[$iHeight][$iWidth] Local $BitmapData = _GDIPlus_BitmapLockBits($pBitmap, 0, 0, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32RGB) Local $Scan0 = DllStructGetData($BitmapData, "Scan0") Local $Stride = DllStructGetData($BitmapData, "Stride") Local $pixel = $Scan0 + $Stride + 4 Local $dPixel = DllStructCreate("dword", $pixel) MsgBox(0, "mBox", "$Scan0=" & $Scan0 & " $Stride=" & $Stride & " pixel=" & $pixel) For $i = 1 To $iHeight Step 1 For $j = 1 To $iWidth Step 1 ; <?> Next Next ; Clean up resources _GDIPlus_BitmapUnlockBits($pBitmap, $BitmapData) _GDIPlus_BitmapDispose($pBitmap) _WinAPI_DeleteObject($hBMP) _GDIPlus_Shutdown()
And yeah, there's where I'm struggling at the moment (see ; <?> line).
I don't get any return value from the DllStructCreate() call (to the $dPixel variable)
The $pixel variable contains at this point 0x026D7A84.
I need help to proceed, and I don't fully understand the $Scan0 and $Stride usage. And how to convert pixel data to x and y coordinates for use in the loop (i and j).
My goal is to get the decimal value of each pixel into the array (exactly the same way as when using the PixelGetColor() method, see above)
hAlp
My understanding of the Using the _WinAPI_MoveFileEx with the $iFlags option set to $MOVE_FILE_DELAY_UNTIL_REBOOT, a file (full path name) should be able to be specified as the $sExistingFile option, and 0 specified as the $sNewFile option, and the file will be deleted on the next reboot.
I've tried the following code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Fileversion=1.0.0.2 #AutoIt3Wrapper_Run_After=copy /Y "%out%" "C:\Temp\*.*" #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPIFiles.au3> MsgBox ( 0, '@ScriptFullPath - Version', @ScriptFullPath & @CRLF & 'Version: ' & FileGetVersion ( @ScriptFullPath) ) Local $Ret = _WinAPI_MoveFileEx ( 'C:\Temp\MovFileExTest.exe', 0, $MOVE_FILE_DELAY_UNTIL_REBOOT ) MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @CRLF & '$Ret' & @CRLF & @CRLF & 'Return:' & @CRLF & $Ret & @CRLF & @CRLF & '@error:' & @CRLF & @error & @CRLF & @CRLF & '@extended:' & @CRLF & @extended & ' (0x' & Hex(@extended) & ')') ;### Debug MSGBOX
The function returns all 0's, but no entry is made in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations) [See MS MoveFileEx function], and of course the file isn't deleted after a reboot.
I want to be able to delete a file or directory on the next reboot. I'm using AutoIt 3.3.10.2.
Any assistance would be appreciated.
I'm really new to RegEx, I'm not sure what I'm doing
I'd like to filter the following:
- Starts with $ letter
- next is unknown char, unknown length
- until one of the following was found: SPACE, equation, comma, @CR, @LF, @CRLF, @TAB, [ letter
So I tried the following:
1st: Start with \$
2nd: Goes on with *
3rd: Next letter is a group of the [ ... ] chars.
I tested and it returns tons of uncorrect results.
Could you help me with it?
Hello guys am triying to click this radio button
The third radio button , but i just can click it by value. i tried to click it by:
But its not working i dont know.. Sorry for my noobs questions but i really dont know ;S. thanks in advanced to all
I'm trying to figure out how to check the status of a checkbox in _IE
I've been looking for a day and trying various things but can't figure it out.
The checkbox is used with AJAX, I can click it using an _IEAction but I haven't figured out how to read the status of it.
Alternatively I could try to check the display status of a div (The div is toggled display:none/display:block when clicking the checkbox)
I am writing a script that sends a command to cmd.exe and I need the function %~n which gives the file name of the variable (a) then I change the extension of the file. The problem is that when autoit sends the function %~n it becomes %ñ in cmd.exe. I get this when typing if I go from ~ to n without hitting space. so I placed this into my autoit script "%~ n". This works with my pc, but when ran from other computers the function fails and resulting output from my scripted program is "%~ na.txt" instead of the desired "input_filename.txt". Since this script is intended for batch processing it doesn't get past the first file processed. Thanks in advance for any help!
Hello guys i want to know how to grab text from a website table ? like this:
i want to get that "Phone Number". i was triying with this but it dont work or i cant make it work :S. anyone can help me ?
Hey guys!
Quick question. As the output of a command (dir /b /s *.*) I get a list of files with their full path.
How do I copy them to a folder?
I've tried "file copy", I assume I need to get on a loop and start reading line by line until I get to the end of the var, but I can't figure out how to do it, I'm pretty green still.
Thanks!
Hi.
Regarding an issue with AutoIT and my AMD Radeon 7950, when a script is running it won't let me card switch off. A simple While 1 loop will keep the GPU awake. I'm not sure if the AMD drivers are to blame or AutoIT, I've tried version autoit-v3.3.6.1 up to v3.3.10.2.
I use MSI Afterburner to monitor my GPU temperature, etc, and once I end the script, it works as normal.
Hey guys,
I'm trying to connect to a Server using RCON via TCP.. The Problem is when trying to send anything the Socket is being Closed!
Login Method = Seed+Password->MD5 (done manually)
My Code:
#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Crypt.au3> #include <Clipboard.au3> #include <IE.au3> ;Removed Login Credentials($IP, $PORT,$PASSWORD) TCPStartup() $socket = TCPConnect($IP,$PORT) If $socket = -1 Then MsgBox(16, "Error", "Die Verbindung zum Server konnte nicht hergestellt werden!") Exit EndIf $FirstAnswer = TCPRecv($socket,1024) MsgBox(0, "Connection Log:", $FirstAnswer) $Hash = TCPRecv($socket,1024) MsgBox(0, "Second Answer", $Hash) $Hash = StringRight($Hash,18); Cut off The Rest to get Hash StringLeft($Hash,2) MsgBox(0, "Showing Hash", $Hash) ; Show Hash _ClipBoard_SetData($Hash) TCPSend($socket,StringToBinary("login"&InputBox("Insert Hash+Password","Here:"))) MsgBox(0, "Result:",TCPRecv($socket,200)); TCPCloseSocket($socket) TCPShutdown()
Output (MsGBoxes): ### Battlefield Play4Free ModManager RCON v8.5 ### Digest Seed: foyKGdlAwLOvlGZD foyKGdlAwLOvlGZD foyKGdlAwLOvlGZD (Entering Hashed Seed+Password) --> NO RESULT GIVEN!
Hope you understand my messy Code!
Any Help is appreciated!
P.S: Connections isnt Working even when Entering "help" instead of the login
Hi!
I was wondering can you do 2 commands at once?
Like Hold the left mouse button down and then scroll?
I mean like if i press a button that i have "binded" in the script, can i when i press it my mouse hold down left button and scroll at the sametime?
or do i have to make two scripts at once that scrolls and holds left mouse button down?
I know it's not a big "task"
but i haven't found it!
Fast Answer is Appreciated!
I have been trying to create an autoit frontend to replace my .bat files for ffmpeg. I have tried what I could find in past posts here, but couldn't get any working. I need a script that will run all files in the dir reguardless of type, like the [for %a in ("*.*")] command in .bat. I would also like a progress bar for the current ffmpeg encode (not folder progress). Any help would be greatly appreciated!
I have a mother script that generates a UDF file for a child script. Everything works and has tested properly but I realized that a couple times it generated it with the #include-once and some of the #include <Lib.au3> moved around a bit. It still worked but I wanted to make sure this wasn't going mess anything up in the long run. The file is all functions and constants and the #include always stays outside for functions
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Example() Func Example() Local $nEdit, $nOk, $nCancel, $msg Opt("GUICoordMode", 2) GUICreate("My InputBox", 190, 114, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; start the definition GUISetIcon("Eiffel Tower.ico") GUISetFont(8, -1, "Arial") GUICtrlCreateLabel("Prompt", 8, 7) ; add prompt info GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP) $nEdit = GUICtrlCreateInput("Default", -1, 3, 175, 20, $ES_PASSWORD) ; add the input area GUICtrlSetState($nEdit, $GUI_FOCUS) GUICtrlSetResizing($nEdit, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) $nOk = GUICtrlCreateButton("OK", -1, 3, 75, 24) ; add the button that will close the GUI GUICtrlSetResizing($nOk, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE + $GUI_DOCKHCENTER) $nCancel = GUICtrlCreateButton("Annuler", 25, -1) ; add the button that will close the GUI GUICtrlSetResizing($nCancel, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE + $GUI_DOCKHCENTER) GUISetState() ; to display the GUI ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example
Is it somehow possible to make a GUI resizable, but to define a size which is the minimum?
I want to make a GUI similar to the one in the example which is resizable but would not get so small that some of the elements wouldn't be visible anymore. I am out of ideas ...
Thanks for any help.
#include <GUIConstantsEx.au3> GUICreate("My GUI style") ; will create a dialog box that when displayed is centered $button = GUICtrlCreateButton(" GO ", 20, 20) GUICtrlSetState($button, $GUI_DISABLE) GUICtrlSetTip($button, "text") GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd
Thank you