MsgBox(0, "My First Script!", "Hello World!")
參數二"My First Script!" 為窗口標題,參數三"Hello World"為窗口內容。
MsgBox(0, "My second script!", "Hello from the main script!")
MsgBox(0, "My Third Script!", "Hello from the functions!")
執行腳本後首先會彈出一窗口標題為My second script,當您關閉它後,另一標題為My Third Script窗口會出現,需要留意的是兩個窗口是不會同時出現的。
The special array $CmdLine is initialized with the command line parameters passed in to your AutoIt script. Note the scriptname is not classed as a parameter; get this information with @ScriptName instead. A parameter that contains spaces must be surrounded by "double quotes". Compiled(己編譯的) scripts accept command line parameters in the same way.
$CmdLine is number of parameters
$CmdLine is param 1 (after the script name)
$CmdLine is param 2 etc
$CmdLine[$CmdLine] is on
So if your script is run like this:
AutoIt3.exe myscript.au3 param1 "this is another param"
$CmdLine equals... 2
$CmdLine equals... param1
$CmdLine equals... this is another param
@ScriptName equals... myscript.au3
In addition to $CmdLine there is a variable called $CmdLineRaw that contains the entire command line unsplit, so for the above example:
$CmdLineRaw equals... myscript.au3 param1 "this is another param"
It is possible to take your .au3 script and compile it into a standalone executable; this executable can be used without the need for AutoIt to be installed and without the need to have AutoIt3.exe on the machine.
In addition, the compiled script is compressed and encrypted and there is the option to bind(裝入) additional files (also compressed/encrypted) to the exe using the FileInstall function(函数). Also, any #include files will also be compiled into the script so they are not required at run-time(運行當中).
Aut2Exe can be used in three ways:
Aut2exe.exe /in <infile.au3> [/out <outfile.exe>] [/icon <iconfile.ico>] [/nodecompile] [/comp 0-4] [/pass <passphrase>]