• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[AutoIt School] Basics - Hello World - LESSON 1

Zysen

=)
Joined
Sep 18, 2010
Messages
2,270
Reaction score
170
Location
Bosnia & Herzegovina
I decided to make a little tutorial for this language.It's called AutoIt and it's really cool :eek:
This tutorial will teach you how to display a message box by use of native function, explain parameters of functions, the use of numeric flags, and basic use of strings and comments.


First we need to download AutoIt v3.
You can get it HERE.

Install it.
When you installed it go to Start -> All programs -> AutoIt v3 ->SciTE Script Editor [open SciTE script editor].
When you are saving you need to save it as .au3 file.
We will start with the classic 'Hello World'.


The steps

1.Create a new script using SciTE Script Editor and open it with it;
2.Now you need to enter this code:

Code:
MsgBox(0, "AutoIt", "Hello World!")
Save the file. NOTE: Save it as .au3 file.

3.Now we want to tell AutoIt to display a message box.Run the script either in:

a) Right click > Run Script on the saved .au3 file in explorer
b) In SciTE,going to Tools > Go or pressing <F5>

4.Congratz! You just created your first AutoIt script! :p


Explanation

Almost every function in AutoIt will take a parameter. Parameters define what is to be done in a function, and changes things, such as text and how certain things are displayed. For this example, the MsgBox takes three parameters - a flag, a title and a message. The first parameter, the flag is a number that changes the way MsgBox displays. In this example we used 0. The next 2 parameters, the title and message are both strings. When using strings in AutoIt you are able to surround the text in double or single quotes. Both "This is some text" and 'This is some text' will work fine. Later on in this book we will discuss strings in more depth.


Extended Script[Work]

So we used the function MsgBox, gave it a title and a message, and ran it. But we can do more to make the message box gain more attention, or to make it look different to standard. To change the effect that our message box created, we can alter the flag parameter. With the flag we can change the icon, some display options, what buttons are displayed, and much more.Here's something from the help file.You can also open 'Function Reference' Folder in help file,find msg box and see this:

bpHhDoPLIp.png


As you can see, there is the title of the function, a short abstract of what the function does, the parameters of the function, return values, the remarks section, containing the flags to alter our message box and some more information that may help the reader, related functions, and an example.

VGZn5zrArP.png


Now to change how our message box displays. As you can see by the picture above we can change the icon displayed, and the buttons. So how can we do that? In the remarks section the help file, there is a table containing the flags for changing the message box. To use more than one flag add them together. Experiment with different values and see what you get.

Remember, add the flag values together, and if you run your script and nothing happens, there is no need for alarm. It is more than likely that you have made a mistake in adding the values together.One of the simplest methods for combining flags is using a calculator, and it is also fairly foolproof.


This is the full code for this example and some extended examples.

Code:
; Script Start - Add your code below here
;Basic Example
MsgBox(0, "AutoIt", "Hello OtLand!")
;Extended Work
MsgBox(18, "AutoIt", "Hello OtLand!"); Abort, Retry, Ignore with Stop Icon
MsgBox(32, "AutoIt", "Hello OtLand"); Normal message box with exclamation icon.
MsgBox(12345, "AutoIt", "Hello OtLand") ; A message box with and invalid flag. This will NOT display.


Hope I learned you something!
 
Last edited:
I'll give a test:

Code:
Test:

Alright, I will give you a little test now, you may PM me the script, and I will send you a reply back what you did wrong, or if its correct.

Alright

Make 4 Ok massageboxes, with the title: “This is my first test”
Text may be anything, but it has to be real words.

Make 2 Yes/No massageboxes.

NOTE: You do not have to do this, this is a test for yourself.
 
Last edited:
Thanks! Most for founding this program for me but anyways i'm using it for hotkeys alot now. Thanks :D Keep it up:D
 
i created 3 bots, client installer, audio player and some game's fakers :p it's very good program for beginers
 
I would suggest using c# or another c programming language as a starter, they have a lot more capabilities within the windows world.
 
This is awesome, it can help alot in making simple and useful programs, plus I have seen awesome programs made with this.
Thanks for posting this useful software!
 
Back
Top