Clever Geek Handbook
πŸ“œ ⬆️ ⬇️

Autoit

AutoIt is a free language for automating task execution in Microsoft Windows . Allows you to create automation scripts (sometimes called macros ) that can simulate user actions, such as text input and the effects on system and program controls, and also respond to events (for example, perform certain actions when opening a window with a specific header). Such scripts are useful for performing repetitive tasks, such as installing identical sets of programs on a large number of computers.

Autoit
Autoitlogo.png
Language class, and
Execution typeinterpretable compiled
Appeared inJanuary 1999
AuthorJonathan Bennet and AutoIt Team
File extensionor
Release3.3.14.5 ( March 16 , 2018 )
Experienced influenceBASIC
Influenced byAutohotkey
License
OS
Siteautoitscript.com

The AutoIt language is simple, has an external similarity to Visual Basic and is close in its general functionality to general-purpose languages, but is distinguished by the presence of built-in tools that give easy access to events, processes, elements of the system’s graphical interface and programs. Includes GUI-framework, which allows using simple Windows-forms with typical graphical components in scripts.

Language

The AutoIt language itself is close to the modern versions of BASIC : it is an imperative language with a small set of typical syntactic structures and a simple structure. Two types of variables are supported: simple (scalar) variables and arrays. Simple variables have a variant type, that is, they can contain values ​​of any supported type. AutoIt arrays are dynamic and heterogeneous (they can change size and contain values ​​of any type in cells), multidimensional (up to 64 index) arrays are supported. The data type set is limited: these are strings, numbers, binary data, and logical (boolean) values.

Available syntactic constructions include three variants of the conditional operator, loops, and the declaration of a user-defined function (function nesting is not supported). There is no modularity as such in the language; it replaces the possibility of direct textual inclusion of some files into others using the C-like instruction #include .

The system library includes a wide range of functions for various purposes, including for working with strings, computing, accessing files, networking, working with vector and raster graphics and data in various multimedia formats. The library includes a simple GUI framework that makes it easy to create and use standard Windows forms with a standard set of controls. The latter feature allows you to use AutoIt simply as a language for creating simple programs for Windows with a standard graphical interface. But the most important feature of AutoIt is the support of a number of specific functions that give access to the Windows system, its settings and the graphical user interface, which allows you to simulate keystrokes, mouse movements and manipulate windows, controls, track system events and respond to them. This allows you to automate the tasks of a Windows user in a way that is impossible or difficult in other programming languages. In particular, the following features are supported:

  • Unicode (starting with version 3.2.4.0).
  • Regular expressions in Perl style ( PCRE library is used).
  • Run console applications and access to standard I / O streams.
  • Run programs on behalf of another user (RunAs function).
  • Compressing and protecting the executable file from decompiling using the UPX wrapper
  • Creating GUI GUI , information messages, information entry forms.
  • Calling functions from dynamic libraries and Windows API functions.
  • Working with the Windows registry , clipboard , files (read, modify, copy, delete).
  • Working with COM objects (component object modeling).
  • Interception and emulation of keyboard clicks and mouse clicks.
  • Working with windows (it is especially easy to work with graphical elements from Windows): moving, hiding, displaying, resizing, activating, closing. Windows can be accessed by their title, displayed text, size, location, class, Win32 API internal handle, defined using the bundled Au3Info utility.
  • Obtaining information and interaction with controls (especially standard ones): edit field, switch, list, buttons, status bar, etc., including inactive ones.
  • Reading HTML pages, downloading files, working with FTP , sending E-mail messages, working with MySQL and SQLite databases .
  • Work with TCP and UDP protocols .
  • Browser automation: Internet Explorer , Opera , Firefox , Google Chrome .
  • Work with sound and music.
  • Play video in AVI format.
  • Work with vector graphics and popular image formats.
  • User Account Control (UAC) support in Windows Vista and higher.

About the program

The AutoIt suite includes 32-bit and 64-bit interpreter versions and is compatible with all versions of Windows, starting with Windows XP , both 32-bit and 64-bit. The AutoIt interpreter is small and does not require mandatory installation. The main file is enough for work, and any text editor is enough for creating a script. There is also a component AutoItX - a combined version in the form of COM and DLL , which allows to integrate the AutoIt interpreter into programs written in other languages. Another important component of the system is a separate utility that allows interactive selection of visual interface elements (windows, separate controls) and receiving information about them, in particular, identifiers of windows and controls. This information is necessary to create scripts that simulate the work of the user with a graphical user interface of the system and programs.

In the full version ( AutoIt Full Installation ), AutoIt is distributed with an integrated development environment based on the free SciTE editor. Also on the official website, you can download an extended editor with additional features [2] . The compiler, auxiliary utilities and reference materials are fully integrated, which makes the editor a standard environment for developers using AutoIt. The AutoIt compiler and the SciTE development environment are easy to install and do not require additional settings (for correct support of the Russian language, the editor will need to uncomment one line in the configuration file). There is complete documentation on AutoIt and SciTE in Russian [3] [4] , and the ability to install the full version of the editor.

The interpreter is compact, works on all versions of Windows "out of the box", without external .dll-libraries and registry entries, which allows you to safely use it on servers . It also supports the compilation of the script into a self-sufficient executable file, which can be run independently without an interpreter or any required libraries, while it is possible to include in the object file additional files that will be extracted at launch.

Application

Popular use of AutoIt is the development of utilities for Microsoft Windows. Common tasks such as website monitoring, network monitoring, disk defragmentation, and backup can be automated and combined into a user-specific utility.

Often, AutoIt is used to create bots for online games . Bots allow you to automate some actions in games, as a result, the user can quickly achieve the desired result. This use of Autoit is not endorsed by the community, as it creates a bad reputation for the program, however several similar scripts can be found on the official forum. The use of bots is considered by most AutoIt users to be unfair, and you should not expect much help from the community in creating them. Many community members do not consider such requests at all.

To simplify the development of graphical interfaces, there is a visual form editor Koda FormDesigner , which has an interface similar to Delphi IDE . Visual creation and editing of all dialog elements available in AutoIt (buttons, input fields, menus, etc.) is supported.

Versions, support, licensing

AutoIt is free, but not free in terms of software licensing. The source code for AutoIt 3.1.0 in C ++ is available for download in the AutoIt archive ; The code of further versions is closed. Modern versions of AutoIt are distributed under the EULA license, which, in particular, explains the termination of support for decompiling scripts (since it is expressly prohibited by this license) [5] .

The AutoIt source code was used to create the AutoHotkey language. It was developed by a small team, but with the active support of users from around the world. Third-party support includes, in particular, help files, sample programs, technical support forums, a mailing list, utilities.

The current version of the language is available for download on the official website of the project, as well as previous releases. A Wiki system is available, the project website contains quite detailed system documentation in many languages, and a forum with an active user community is maintained.

Example

Hello World Program:

  ; Displays a standard window with the name "Example", the words "Hello world!" And the "OK" button.
   MsgBox ( 0 , "Example" , "Hello, world!" ) ;

Creating a dialog box:

  ; Displays a dialog box with the buttons "OK" and "Cancel."  If you click "OK" - exit from the program.
   ; Tab in the example - for readability.
   $ WantExit = MsgBox ( 1 , "Question" , "Want to exit the program?" ) 
     If $ WantExit == 1 Then
        Exit
     Endif

Automatic launch of the Notepad program:

  ; Starts Notepad, writes text in its window, closes the program, canceling the save.
   Run ( "notepad.exe" )
   WinWaitActive ( "Untitled - Notepad" )
   Send ( "Here is some text." )
   WinClose ( "Unnamed - Notepad" )
   WinWaitActive ( Notepad )
   Send ( "! N" )

Create a simple clock

  #include < GUIConstantsEx .  au3 > ;  Inclusion of the specified file inside the current script.
   ; - Window ------------------------------
   GUICreate ( Clock , 155 , 111 , 192 , 114 )
   GUISetState ()
   ; -------------------------------------
   ;- Clock ----------------------------------------------- --------------
   AdlibRegister ( "MainScript" , 400 ) ;  Clock update
   $ Clock = GUICtrlCreateLabel ( @HOUR & ":" & @MIN & ":" & @SEC , 50 , 20 )
   ; ------------------------------------------------- -------------------
   ; - Settings ---------------------
   While 1
       $ nMsg = GUIGetMsg ()
       Switch $ nMsg
           Case $ GUI_EVENT_CLOSE
               Exit
       End switch
   Wend
   ; ---------------------------------
   ; - Reconciliation of watches with a computer -----------------------------
   Func MainScript ()
       GUICtrlSetData ( $ Clock , @HOUR & ":" & @MIN & ":" & @SEC )
    Endfunc
   ; ------------------------------------------------- -----------

Creating a window in the center of the display.

  #include < GuiConstants .  au3 >

 #cs
 vCenterDialog
 #ce

 $ Width = "500"
 $ Height = "500"
 $ cWidth = @DesktopWidth / 2 - $ Width / 2
 $ cHeight = @DesktopHeight / 2 - $ Height / 2

 $ Form = GUICreate ( "Dialog" , $ Width , $ Height , $ cWidth , $ cHeight )

AutoIt community

The official English-language forum is located at http://www.autoitscript.com/forum/ . There, users can share their scripts and functions, receive technical support, report bugs, contribute ideas and suggestions, and communicate with developers.

There is also a Russian-speaking community site.

See also

  • Autohotkey
  • Automator
  • Freebasic
  • Hammerspoon
  • Neo Sign 0f Misery
  • nnCron
  • Visual basic
  • Purebasic
  • Powerpro
  • Powerbasic

Notes

  1. ↑ http://www.autoitscript.com/autoit3/docs/license.htm
  2. ↑ AutoIt Script Editor - AutoIt (English) , AutoIt . The appeal date is March 18, 2018.
  3. ↑ AutoIt Documentation Localization (English)
  4. ↑ SciTE Russian-speaking forum on the Ru-board
  5. ↑ Decompiling_FAQ

Links

  • Official site AutoIt (eng.)
  • Russian community AutoIt
  • Overview of the AutoIt scripting language
  • AutoIt v3: Your Quick Guide by Andy Flesner (publication, entirely dedicated to the language) (eng.)
  • The history of the creation of AutoIt (eng.)
Source - https://ru.wikipedia.org/w/index.php?title=AutoIt&oldid=98397813


More articles:

  • Avian Flu
  • Mesa, Enrique Gabriel
  • Karnaukhov, Dmitry Vladimirovich
  • Littuer, Vladimir Stanislavovich
  • Vantadur (Vicotese, then county and duchy)
  • Penkovsky, Stefan
  • Experimental & Molecular Medicine
  • Jeremy Saulier
  • Hoffman, Zdzislaw
  • Party of Patriots of Korea

All articles

Clever Geek | 2019