Start building your web presence at Rs. 499.00/mo

Start building your web presence at Rs. 499.00/mo
Web Hosting Coupon Archives

Auto IT Complete Commands with Directories & Key

How To: Learn Basic AutoIt

How to AutoIt!

Please view this guide here as well its for after you've complete this.


Greetings all Glyn here, this is my first programming guide I have ever posted so I hope you all like it. I put a lot of work into it and I think it will help everyone out a little in the wonderful world of scripting.


First off all, You need to download AutoIT setup and scite editor by clicking on these two links (one is the actual Autoit program and the other is a base of tut's)

Auto IT Setup 
-Download 1

and
Auto IT Scite Editor 
-Download 2
Now before we really start I want to start with a Q/A piece and a little list of various commands because you will have absolutely no idea what your doing if you don't understand the basics.


Q-What is Autoit?


A-AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated 

keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript 

and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!


Q-What can I do with Autoit?


A-You can create, alter or delete your very own programs. For instance the new Autoit V3 has the option of making GUI's (Graphical User Interface) which can be the basis on a major program you might be working on. It can also be used for much more (to much to explain) but remember the sky is teh limit.


Q-What sort of programs have been created by Autoit?

A-Well for one, Noggit (Autoit) see the resemblance. Made by Maul05-the god of autoit scripting. There have been a couple other well known programs made but I'm not sure most here people would know them.

Q-Whats the difference between Autoit scripting and C++ or Javascript?



A-These languages are different in their own way. Each different script will have a different end result. Some languages take ages to learn as well (C++ for example).

Q-What are the current technical linits of Autoit?


A- As follows:
Maximum length of a single script line: 4,095
Maximum string length: 2,147,483,647 characters

Number range (floating point): 1.7E–308 to 1.7E+308 with 15-digit precision
Number range (integers): 64-bit signed integer
Hexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)

Arrays: A maximum of 64 dimensions and/or a total of 16 million elements
Maximum depth of recursive function calls: 384 levels

Maximum number of variables in use at one time: No limit
Maximum number of user defined functions: No limit

Maximum number of GUI windows: 1024
Maximum number of GUI controls per window: 4096 

I will add more if more questions appear later on.

A list of different and useful commands:

Run - Executes a .exe program
 

Sleep(insert # here) - Makes the program hold
 

GUIcreate to GUIswitch - All useful for makeing and altering GUI's

Execute - Executes an expression

Beep - Does exactly as it means

Mousemove(10, 100) - Moves the mouse 10 from the left and 100 from top

Exit - Obvious

Exitloop - Ends a loop

Binary - Returns the Binary Representation of and Expression

Call - Calls a user-defined function

Tan - Calculates the Tangent of a Number

Send - This will send simulated keystrokes to a window

Log - Calculates the natural logarithm of a number

And now for a list of some of the Macro's:

@AppDataCommonDir - Path to Application Data 

@AppDataDir - Path to current user's Application Data 

@AutoItExe - The full path and filename of the AutoIt executable currently running. For compiled 
 scripts it is the path of the compiled script. 

@AutoItPID - PID of the process running the script. 

@AutoItVersion - Version number of AutoIt such as 3.0.81.0 

@COM_EventObj - Object the COM event is being fired on. Only valid in a COM event Function. 

@CommonFilesDir - Path to Common Files folder 

@Compiled - Returns 1 if script is a compiled executable; otherwise, returns 0. 

@ComputerName - Computer's network name. 

@ComSpec - value of %comspec%, the SPECified secondary COMmand interpreter; 
primarily for command line uses, e.g. Run(@ComSpec & " /k help | more") 

@CR - Carriage return, Chr(13); sometimes used for line breaks. 

@CRLF = @CR & @LF ;occasionally used for line breaks. 

@DesktopCommonDir - Path to Desktop 

@DesktopDir - Path to current user's Desktop 

@DesktopHeight - Height of the desktop screen in pixels. (vertical resolution) 

@DesktopWidth - Width of the desktop screen in pixels. (horizontal resolution) 

@DesktopDepth - Depth of the desktop screen in bits per pixel. 

@DesktopRefresh - Refresh rate of the desktop screen in hertz. 

@DocumentsCommonDir - Path to Documents 

@error - Status of the error flag. See the SetError function. 

@exitCode - Exit code as set by Exit statement. 

@exitMethod - Exit method. See the Func OnAutoItExit(). 

@extended - Extended function return - used in certain functions such as StringReplace. 

@FavoritesCommonDir - Path to Favorites 

@FavoritesDir - Path to current user's Favorites 

@GUI_CtrlId - Last click control identifier. Only valid in an event Function. See the 
GUICtrlSetOnEvent function. 

@GUI_CtrlHandle - Last click control handle. Only valid in an event Function. See the GUICtrlSetOnEvent function. 

@GUI_DragId - Drag control identifier. Only valid in an event Function. See the GUISetOnEvent function. 

@GUI_DragFile - Filename of the file being dropped. Only valid in an event Function. See the GUISetOnEvent function. 

@GUI_DropId - Drop control identifier. Only valid in an event Function. See the GUISetOnEvent function. 

@GUI_WinHandle - Last click GUI window handle. Only valid in an event Function. See the GUICtrlSetOnEvent function. 

@HomeDrive - Drive letter of drive containing current user's home directory. 

@HomePath - Directory part of current user's home directory. To get the full path, use in conjunction with @HomeDrive. 

@HomeShare - Server and share name containing current user's home directory. 

@HOUR - Hours value of clock in 24-hour format. Range is 00 to 23 

@HotKeyPressed - Last hotkey pressed. See the HotKeySet function. 

@InetGetActive - Is 1 if a InetGet download is currently active, otherwise is 0. 

@InetGetBytesRead - During a InetGet download this is the number of bytes currently read. It is -1 when there is an error downloading. 

@IPAddress1 - IP address of first network adapter. Tends to return 127.0.0.1 on some computers.

@IPAddress2 - IP address of second network adapter. Returns 0.0.0.0 if not applicable. 

@IPAddress3 - IP address of third network adapter. Returns 0.0.0.0 if not applicable. 

@IPAddress4 - IP address of fourth network adapter. Returns 0.0.0.0 if not applicable. 

@KBLayout - Returns code denoting Keyboard Layout. See Appendix for possible values. 

@LF - Line feed, Chr(10); typically used for line breaks. 

@LogonDNSDomain - Logon DNS Domain. 

@LogonDomain - Logon Domain. 

@LogonServer - Logon server. 

@MDAY - Current day of month. Range is 01 to 31 

@MIN - Minutes value of clock. Range is 00 to 59 

@MON - Current month. Range is 01 to 12 

@MyDocumentsDir - Path to My Documents target 

@NumParams - Number of parameters used to call the user functions 

@OSBuild - Returns the OS build number. For example, Windows 2003 Server returns 3790 

@OSLang - Returns code denoting OS Language. See Appendix for possible values. 

@OSServicePack - Service pack info in the form of "Service Pack 3" or, for Windows 95, it may 
return "B" 

@OSTYPE - Returns "WIN32_NT" for NT/2000/XP/2003/Vista and returns "WIN32_WINDOWS" for 95/98/Me 

@OSVersion - Returns one of the following: "WIN_VISTA", "WIN_2003", "WIN_XP", "WIN_2000", "WIN_NT4", "WIN_ME", "WIN_98", "WIN_95" 

@ProcessorArch - Returns one of the following: "X86", "IA64", "X64" 

@ProgramFilesDir - Path to Program Files folder 

@ProgramsCommonDir - Path to Start Menu's Programs folder 

@ProgramsDir - Path to current user's Programs (folder on Start Menu) 

@ScriptDir - Directory containing the running script. (Result does not contain a trailing 
backslash) 

@ScriptFullPath - Equivalent to @ScriptDir & "\" & @ScriptName 

@ScriptLineNumber - Line number of the currently executed script line. Useful for debug statements specially when a function is call you can pass the caller 
line number. (Not significant in complied script) 

@ScriptName - Long filename of the running script. 

@SEC - Seconds value of clock. Range is 00 to 59 

@StartMenuCommonDir - Path to Start Menu folder 

@StartMenuDir - Path to current user's Start Menu 

@StartupCommonDir - Path to Startup folder 

@StartupDir - Current user's Startup folder 

@SW_DISABLE - Disables the window. 

@SW_ENABLE - Enables the window. 

@SW_HIDE - Hides the window and activates another window. 

@SW_LOCK -Lock the window to avoid repainting. 

@SW_MAXIMIZE - Maximizes the specified window. 

@SW_MINIMIZE - Minimizes the specified window and activates the next top-level window in the  
Z order. 

@SW_RESTORE - Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An  
application should specify this flag when restoring a minimized window. 

@SW_SHOW - Activates the window and displays it in its current size and position. 

@SW_SHOWDEFAULT - Sets the show state based on the SW_ value specified by the program that started the application. 

@SW_SHOWMAXIMIZED - Activates the window and displays it as a maximized window. 

@SW_SHOWMINIMIZED - Activates the window and displays it as a minimized window. 

@SW_SHOWMINNOACTIVE - Displays the window as a minimized window. This value is similar to @SW_SHOWMINIMIZED, except the window is not activated. 

@SW_SHOWNA - Displays the window in its current size and position. This value is similar to

@SW_SHOW, except the window is not activated. 

@SW_SHOWNOACTIVATE - Displays a window in its most recent size and position. This value is similar to @SW_SHOWNORMAL, except the window is not activated. 

@SW_SHOWNORMAL - Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An 
application should specify this flag when displaying the window for the first time. 

@SW_UNLOCK - Unlock windows to allow painting. 

@SystemDir - Path to Windows' System (or System32) folder 

@TAB Tab character, Chr(9) 

@TempDir - Path to the temporary files folder. 

@TRAY_ID - Last clicked item identifier during a TraySet(Item)OnEvent action. 

@TrayIconFlashing - Returns 1 if tray icon is flashing; otherwise, returns 0. 

@TrayIconVisible - Returns 1 if tray icon is visible; otherwise, returns 0. 

@Unicode - Returns 1 if running using the Unicode version of AutoIt (AutoIt3.exe) or 0 if running the ANSI version (AutoIt3A.exe).
Usually, this macro should not be required as AutoIt handles any Unicode/ANSI conversions. However, with certain DllCalls() or use of direct Windows messages 
this may be required. 

@UserProfileDir - Path to current user's Profile folder. 

@UserName - ID of the currently logged on user. 

@WDAY - Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday. 

@WindowsDir - path to Windows folder 

@WorkingDir - Current/active working directory. (Result does not contain a trailing backslash) 

@YDAY - Current day of year. Range is 1 to 366 (or 365 if not a leap year) 

@YEAR - Current four-digit year 



Now for the fun stuff, I'm gonna show you some of the basic commands and how to work them today.

How to make a basic GUI:
________________________________________

Start up by opening 'SciTE Script Editor'.

Now remember, if you key one thing in wrong it will throw off the ENTIRE outcome.

The first thing you'll want to type is-

#include <GUIConstants.au3>

GUICreate("My GUI Checkbox") ; you can edit in between the ""s so it will be titled differently.

$checkCN = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)

GUISetState () ; will display an dialog box with 1 checkbox and you can make more by duplicating the above code and altering the position points.

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

________________________________________

It should end up looking like this:



and the outcome like this:



If it doesn't than you've obviously written something incorrectly.


Next I'll show you how to open a hyperlink to a selected webpage (MMOwned for example).

Key in:

#include <IE.au3>

; Create a browser window and navigate to hotmail
$oIE = _IECreate()
_IENavigate($oIE, "mmowned.com")


Exit

Now if you don't plan to use Internet Explorer (IE) you'll have to change some parts but I'll leave that out for now. MF > IE

In the end it should look like this:



And it should take you to the front page of MMOwned.com, I could have added for it to log you in automatically but I know it would look like a scam so you'll 
have to figure that out for yourself.

Another way to go to a web page is accessing the DOS window, it'll look like this:

$rc = _RunDos("start Http://www.mmowned.com")

I'm going to add an advanced part to this guide now its an anti afk bot for World of Warcraft and it will look something like this-

$move = Random (1, 100, 1)
If $move < 50
Send (“{RIGHT down}”)
Sleep (500)
Send (“{LCTRL}”)
Sleep (2000)
Send (“{RIGHT up}”)
Else
Send (“{LEFT down}”)
Sleep (500)
Send (“{LCTRL}”)
Sleep (2000)
Send (“{LEFT up}”)
EndIf



Now the best part of this bot is that it generates a random movement each time so that it doesn't just make you step forward every so often. Thats why whenever I make myself a bot I make sure that it has randomly generated movements in it.
I just want to state that this is more of a difficult script and wouldn't suggest attempting these on your own until you've masted the tut's and lessons.

This guide is just to show the basics in Autoit (I plan on putting more up soon for more advanced pupils). I hope you all learned something and kept up with 
what I was saying.
SHARE

yash

  • Image
  • Image
  • Image
  • Image
  • Image

0 comments:

Post a Comment