AutoIt

AutoIt is a freeware programming language for Microsoft Windows. In versions 1 and 2, it was used to create automation scripts for Microsoft Windows programs. These are sometimes called macros. In version 3, the programming language was extended to allow it to do more things.
The scripting language in AutoIt 1 and 2 was statement-driven. It was designed to simulate a user's input to the computer. From version 3 onward, the AutoIt syntax changed. It is now similar to the BASIC programming language. AutoIt version 3 is a general-purpose programming language. It can have types of data, such as arrays.
An AutoIt script can be converted into a stand-alone executable. This can be run on computers that do not have the AutoIt interpreter installed. A wide range of function libraries are available. They are known as UDFs, or "User Defined Functions". Some are included as standard. Others are available from the website. They add extra abilities to the language. AutoIt has a special editor, an Integrated development environment or IDE. It is based on the free SciTE editor. The compiler and help text are included in this special editor and provide a standard environment for developers.
Usage.
AutoIt is often used to produce utility software for Microsoft Windows. These programs can automate routine tasks. Example use includes: systems management, monitoring, maintenance, and software installation. It is also used to simulate user interaction. In this use an application is "driven" to do things by an AutoIt script which behaves like a human user. An AutoIT script can issue keypresses, mouse clicks, type text and so on. In this way it simulates a human user of an application.
AutoIt has been used in low-cost laboratory automation. Applications include instrument synchronisation, alarm monitoring and results gathering. Devices such as 3D-printers can also be controlled.
Examples.
Hello world.
&lt;syntaxhighlight lang="autoit"&gt;
MsgBox($MB_SYSTEMMODAL, "Title", "Hello, world!")
&lt;/source&gt;
Automating the Windows Calculator.
&lt;syntaxhighlight lang="autoit"&gt;
MsgBox($MB_OK, "Attention", "Avoid touching the keyboard or mouse during automation.", 6)
Run("calc.exe")
WinWaitActive("[CLASS:CalcFrame]", "", 10)
If WinExists("[CLASS:CalcFrame]") = 0 Then Exit
Send(@YEAR)
Sleep(600)
Send("/4")
Sleep(600)
Send("{ENTER}")
Sleep(600)
Send("^c")
Local $fResult = ClipGet()
If StringInStr($fResult, ".") Then
 ; Display a message box with a timeout of 5 seconds.
 MsgBox($MB_OK, "Leap Year", @YEAR &amp; " is not a leap year.", 5)
Else
 ; This message will only display if the current year is a leap year.
 MsgBox($MB_OK, "Leap Year", @YEAR &amp; " is a leap year.", 5)
EndIf
WinClose("[CLASS:CalcFrame]")
&lt;/source&gt;
Find average.
&lt;syntaxhighlight lang="autoit"&gt;
_Example() ; Run the example.
Func _Example()
 ; Display an input box and ask the user to enter some numbers separated by commas.
 Local $sInput = InputBox("Find Average", "Enter some numbers separated by commas: 1,2,42,100,3")
 ; If an error occurred then exit the script.
 If @error Then Exit
 ; Populate an array with the user's input.
 Local $aSplit = StringSplit($sInput, ",")
 ; Pass the array to the function _Find_Average() and then check for errors.
 Local $fAverage = _Find_Average($aSplit)
 If @error Then Exit
 ; Display the result in a message box.
 MsgBox($MB_OK, "Find Average", "Result: " &amp; $fAverage)
EndFunc ;==&gt;_Example
Func _Find_Average($aArray)
 ; If the input is not of the correct type (an array), then return an error along with the details.
 If Not IsArray($aArray) Then Return SetError(1, 0, VarGetType($aArray))
 ; More detailed checks are possible, but for brevity just one is performed here.
 ; Declare a variable to store the sum of the numbers.
 Local $iArraySum = 0
 ; Loop through the array.
 For $i = 1 To $aArray[0]
 ; Increment the sum by the number in each array element.
 $iArraySum += Number($aArray[$i])
 Next
 ; Return the average rounded to 2 decimal places.
 Return Round($iArraySum / $aArray[0], 2)
EndFunc ;==&gt;_Find_Average
&lt;/source&gt;
License.
The developers of AutoIt originally released the source code under the GNU General Public License (GPL). 
In 2006, the license was changed for version 3.2.0 and later versions to their own closed source license.
Some of the code from version 3.1 was used to create a fork by the AutoHotkey project. This was allowed under the GPL licence terms. The AutoHotkey community is continuing to develop and release the code under the GPL.