Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

AutoIT


AutoIT

By ghostghost | 7290 Reads |
0     0

Introduction


Hi, this is SniperSA, and I shall introduce the tool AutoIT. I use this for things like checking email, logging into HBH, basically anything that I can. The tool is a little bit like Visual Basic. In this document, I shall go over the basics of AutoIT. Before I get started, to download AutoIT, go to here: http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3.2.2.0-setup.exe After you download that, I suggest you use SciTE with AutoIT because it makes the code look better, and you can tell when you make an error. To download SciTE (HIGHLY RECOMMENDED ESPECIALLY FOR PEOPLE JUST STARTING WITH AUTOIT) http://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe The help file that comes with AutoIT is extremely helpful, that's how I self taught myself.


Getting started.


Now if you right click on your desktop, you see a new command in New. AutoIT 3 Script. So right click on your desktop and hit new->AutoIT 3 Script. Now open up the script. You see a blank page, so lets add some code.


Coding in AutoIT


Well you people should see this coming, our first program/script is always that friggin Hello World! script. So on the first line type MsgBox. If you are using SciTE, when you first type M in MsgBox you see it appear under it, and you can hit enter to auto-fill it in. MsgBox(, Now we need to declare what's going to happen in this MsgBox when it appears. MsgBox(0,"HBH owns!","Hello World!"), Now, what this code says is that it wants the script to bring up a message box with 0 being a flag for an OK button, with the title of HBH owns, and with Hello World! as what appears in the box. Now, whenever you declare a variable in AutoIT it appears as $ then whatever you want. So for example if you want a variable to be labeled A for future reference in the code, you would put $A. Now, let's do a simple input code. $A = InputBox("Enter Text","Input something!") MsgBox(0,"Test",$A) Now, that we have variables, lets learn the helpful things now that we know the basics. 2 good commands that are used in almost all my codes are Sleep() and Send(). With sleep, it is in ms so like Sleep(4000)=4 second wait in the code. Next is Send. With send Send("Test") would force the computer to type test. Send("{Enter}") would send the enter button. Basically if I want to hit like TAB or F5 it would be Send("{TAB}"), Send("{F5}"). Also, remember variables? Well, I could also Send($A)! Well, lets learn how to do a loop. This code right here is basically multiple things compiled in this lesson. Hotkeyset("{ESC}","Endscript") ;this is to quit it $A = 0 Do ;this starts the loop MsgBox(0,"Do..Until Loop", $A) $A = $A + 1 ;remove to make the loop forever Until $A = 10 ;this is telling to run 10x Func Endscript() End 0 Endfunc Now one final thing before I go, Please use the help file that comes with AutoIT, it has everything you need with examples for everything. In the future, I may make a more advanced article if people enjoy reading this and are interested in more of AutoIT. Thanks, -SniperSA


Comments
Sorry but there are no comments to display