kids encyclopedia robot

AutoIt facts for kids

Kids Encyclopedia Facts
Quick facts for kids
AutoIt
Autoitlogo.png
AutoIT example script.png
Paradigm imperative, functional, procedural, reflective
Designed by Jonathan Bennett
Developer AutoIt Consulting Ltd.
First appeared January 1999; 26 years ago (1999-01)
Stable release
3.3.16.1 / September 19, 2022; 2 years ago (2022-09-19)
Preview release
3.3.16.1 RC2 / June 9, 2022; 3 years ago (2022-06-09)
Platform IA-32 and x64
OS Windows XP SP3 and later
Windows Server 2003 and later
License Freeware
Filename extensions .au3
Influenced by
BASIC

AutoIt is a freeware (free to use) programming language made for Microsoft Windows computers. It was first created to help people make automation scripts. These scripts are like mini-programs that can control other programs automatically. Think of them as "macros" that do repetitive tasks for you.

Over time, AutoIt has grown a lot. It's now a full programming language with many features. The way you write code in AutoIt is similar to the BASIC family of languages. This means it's a general-purpose language. It can store different kinds of information, including lists of data called arrays.

One cool thing about AutoIt is that you can turn your automation script into a single, ready-to-run program. This program can then be used on any computer, even if that computer doesn't have AutoIt installed. AutoIt also comes with many extra tools called "User Defined Functions" (UDFs). These UDFs add even more special abilities. You also get a special editor called SciTE to help you write your AutoIt code.

History of AutoIt

Release timeline
1999 January: First AutoIt Version (1.0)
August: AutoIt v2 and AutoItX
September: First AutoIt version with Compiler
2000
2001
2002 December: AutoIt v3 (Public Beta)
2003
2004 February: AutoIt v3 (Stable)
2005
2006 September: Auto3Lib started
2007 November: AutoIt v3.2.10.0 released, Auto3Lib incorporated into AutoIt v3
2008 May: AutoIt v3.2.12.0 released, incorporating added GUI functionality
December: AutoIt (and AutoItX) v3.3.0.0 released
2009 December: AutoIt v3.3.2.0 released
2010 January: AutoIt v3.3.4.0 released
March: AutoIt v3.3.6.0 released
April: AutoIt v3.3.6.1 released
2011 December: AutoIt v3.3.8.0 released
2012 January: AutoIt v3.3.8.1 released
2013 December: AutoIt v3.3.10.0 released
2014 June: AutoIt v3.3.12.0 released
2015 July: AutoIt v3.3.14.0 and v3.3.14.1 released
September: AutoIt v3.3.14.2 released
2016
2017
2018 February: AutoIt v3.3.14.3 released
March: AutoIt v3.3.14.5 released
2019
2020
2021
2022 March: AutoIt v3.3.16.0 released
September: AutoIt v3.3.16.1 released

The first versions of AutoIt, AutoIt1 and AutoIt2, were "closed-source." This means their code was private, and people couldn't see or change how they worked. Their way of writing code was also very different from AutoIt3.

AutoIt3 started as "open-source" software. This means its code was available for anyone to see and even improve. It was released under the GNU General Public License in February 2004. However, after August 2004, AutoIt3 became closed-source again. All new versions since February 2005 have been closed-source. Version 3.1.0 was also the first to let you create graphical user interfaces (GUIs), which are the windows and buttons you see in programs.

Projects Similar to AutoIt

The AutoHotkey project is a free and open-source program that was inspired by AutoIt. It used some parts of AutoIt's early code. However, the way you write code in AutoHotkey is quite different from AutoIt3. It's more like the older AutoIt2.

What AutoIt Can Do

AU3 Script File Format Icon
AU3 File Format Icon

AutoIt is often used to create small helpful programs for Microsoft Windows. It's great for making your computer do routine tasks automatically. For example, it can manage your system, monitor things, or even help install software.

It can also pretend to be a user. This means an AutoIt script can "drive" an application by automatically typing, clicking the mouse, or filling in forms.

AutoIt can even be used in labs to control equipment. It can help with things like making instruments work together, watching for alarms, or collecting results. You can also use it to control devices like CNC routers and 3D printers.

Here are some of AutoIt's features:

  • It works with modern 64-bit computers (since version 3.2.10.0).
  • You can add extra libraries (collections of code) for specific programs.
  • It can automatically send keyboard presses and mouse clicks to programs.
  • It can use special functions found in DLL files (parts of other programs).
  • It works well with User Account Control (Windows security features).
  • You can turn your scripts into standalone programs that anyone can run.
  • You can create your own windows, buttons, and message boxes.
  • It can include other files inside your compiled program.
  • It can control windows and running programs.
  • You can use an Object-oriented style of programming with a special library.
  • It can play sounds, pause them, resume them, and control where they are playing.
  • It can run command-line programs and get information from them.
  • It's a scripting language for Windows with a structure similar to BASIC.
  • It can simulate mouse movements.
  • It supports component object model (COM), which helps programs talk to each other.
  • It understands regular expressions (special patterns for finding text).
  • It supports TCP and UDP (ways computers send data over networks).
  • It supports Unicode (a way to handle many different characters and languages) since version 3.2.4.0.

Examples of AutoIt Code

Hello World Example

This simple script shows a message box that says "Hello, world!".

; Make available a library of constant values.
#include <MsgBoxConstants.au3>

; Displays "Hello, world!" in a message box.
MsgBox($MB_SYSTEMMODAL, "Title", "Hello, world!")

Automating the Windows Calculator

This script opens the Windows Calculator and does a simple math problem.

; Make available a library of constant values.
#include <MsgBoxConstants.au3>

; Display a message box with a timeout of 6 seconds.
MsgBox($MB_OK, "Attention", "Avoid touching the keyboard or mouse during automation.", 6)

; Run the Windows Calculator.
Run("calc.exe")

; Wait for the calculator to become active with a timeout of 10 seconds.
WinWaitActive("[CLASS:CalcFrame]", "", 10)

; If the calculator did not appear after 10 seconds then exit the script.
If WinExists("[CLASS:CalcFrame]") = 0 Then Exit

; Automatically type the current year into the calculator.
Send(@YEAR)

; Let's slow the script down a bit so we can see what's going on.
Sleep(600)

; Automatically type in 'divide by 4', and then sleep 600 ms.
Send("/4")
Sleep(600)

; Hit the return key to display the result, and sleep 600 ms.
Send("{ENTER}")
Sleep(600)

; Copy the result to the clipboard using the Windows shortcut Ctrl+C.
Send("^c")

; Declare, and assign the contents of the clipboard to, a variable.
Local $fResult = ClipGet()

; Check to see if the variable contains a decimal point or not.
If StringInStr($fResult, ".") Then
    ; Display a message box with a timeout of 5 seconds.
    MsgBox($MB_OK, "Leap Year", @YEAR & " 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 & " is a leap year.", 5)
EndIf

; Close the Windows calculator - always tidy up afterwards.
WinClose("[CLASS:CalcFrame]")

Find Average Example

This script asks you to enter numbers and then calculates their average.

; Find Average by JohnOne, modified by czardas
#include <MsgBoxConstants.au3>

_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: " & $fAverage)
EndFunc   ;==>_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   ;==>_Find_Average

See also

Kids robot.svg In Spanish: AutoIt para niños

  • AutoHotkey
  • Automator (for Macintosh)
  • Expect
  • iMacros
  • Keyboard Maestro (for Macintosh)
  • KiXtart
  • Macro Express
  • thinBasic
  • Winbatch
kids search engine
AutoIt Facts for Kids. Kiddle Encyclopedia.