How to AutoIt!
Ok, so for most of you I hope you have taken a look at my previous guide that can be found here as this is step #2 in becoming a better AutoIt scriptor. In this phase of the training I am going to show you how to use AutoIt in a most majestic
way. It will get scary and I won't blame you if you break down crying but please.. try and follow along :/
First off make sure you have these downloaded:
Download
&
Download
I'm also going to suggest downloading this as well:
AutoIt 123
This is extremely helpful for the newbie for it has example's, tutorials, lessons and much much more! I take no credit for making this either It was taken from (Welcome to AutoIt 1-2-3 - AutoIt Forums) by Valuater.
Ok I am going to show you how to make a GUI with a button that (when pressed) will trigger something to happen and hopefully do what you want it to do.
For my example I am going to make a GUI that opens web pages -
Now to start with the actual GUI (the little box, button and imput box). So you should start with the basic GUI commands:
#include <GUIConstants.au3>
$GUI = GUICreate("Press X to exit", 150, 100, -1, -1) ; this creates the Box and the title in the blue bar
$URL = GUICtrlCreateInput("", 10, 70, 130, 20) ; Imput box (fool around with the numbers to change size)
GUICtrlCreateLabel("MMOwned pwns", 10, 10) ; The little saying - you can change text
$GO = GUICtrlCreateButton("GO", 10, 35, 130, 25) ; The Button
Then once you have completed that you have made the part of the program that you will see. This is the harder part:
GUISetState()
While 1
Switch GUIGetMsg()
Case - 3
Exit
Case $GO
Run("cmd /c start " & GUICtrlRead($URL), "", @SW_HIDE) ; sends a message to the cmd (command prompt) to go to the url
EndSwitch
WEnd ; Makes everything stop
This part will make it so that when a website is typed into the imput box (Sign In) and the button is clicked a message is sent to the cmd:
and open the website with your default webrowser. Now this is only one of the many fabulous things that you can do with this technology (you can make a button to.. start WoW, open various files, run searches ect ect ect.) the sky is the limit. In the end your webpage opener script should look something long these lines:
There are other ways for it to be done but this is probably the quickest, shortest and easiest. Here is my finished products download if you want to compare - Glyns Web Page Program.
Now for the second part of my guide I am going to show you how to turn all these programs you made into downloadable .exe's that you can share with online communities all over the world.
First find a program that you have created (i'll use the one that I just made) and go to -
Start/All Programs/AutoIt v3/Compile Script to .exe
Now once selected a new box should open, it looks something along these lines:
Now click the top browse button and find your file you want to turn into a .exe then make a new file on desktop (doesn't matter what it is but sometimes it can be fussy and won't turn into an .exe) and rename is XXX.exe like so :
Then click the second browse button and find your newley made .exe file. At the bottem it lets you select an icon for your program (it has about 10 you can choose from, but you can add your own if needed). Select whatever floats your boat. Don't worry about the little box that says ANSI for now and hit 'Convert' at the bottem.
If this is done correcty a box should pop up saying "conversion complete" and there you go. Upload it wherever you want.
I hope you enjoy this second part of my AutoIt guides so far (expect a thrid sometime in the near future) and I hope you all learned something here today. Guide #3 might include botting and creating more advanced GUI's.
Have a good day everyone! Remember Superman says stay in school!
Glyn - The Eater of Worlds -
<3