Results 1 to 1 of 1

Autoit and You: The BASICS

This is a discussion on Autoit and You: The BASICS within the Tutorials forums, part of the Programming category; What is autoit? AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. ...

  1. #1
    nosnipe is offline Subscriber
    Join Date
    Jul 2009
    Posts
    413

    Default Autoit and You: The BASICS

    What is autoit?
    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!

    AHK vs Autoit:
    This all comes down to what you feel comfortable with , i prefer autoit because it is more structured and and therefor easy to understand for beginners and advance users alike,
    autoit came first , AHK is a branch off autoits sourcecode. alot of people here prefer AHK but i bet you never even heard of autoit before.


    Differences:

    AHK
    Code:
    ^z::
    mousegetpos , MouseX,MouseY
    PixelGetColor,color, %MouseX%,%MouseY%
    msgbox %color%
    return
    Autoit:
    Code:
    hotkeyset("{F1}","GetPixelPos")
    
    $G = "Found it!"
    $B = "Nope!"
    $P = 0
    
    Func GetPixelPos()
    $XY = mousegetpos()
    $Sum = PixelGetColor($XY[0],$XY[1])
    $Var = "0x" & Hex($Sum,6)
    if $Var = "0xED1C24" Then
    	msgbox($P,"",$G)
    Else
    	msgbox($P,"",$B)
    EndIf
    EndFunc
    this is a function to grab the color at mouse pointer they both do the same things , as you can see in autoit its a bit more lines of code but i am also displaying it via a messagebox window and not a tooltip , on the flip side its easier to understand and the syntax is well laid out. On the other Hand AHK has as you can see has fewer lines of code but is "sloppy" and the syntax has more of a "real" programming language feel to it.

    Autoit
    Code:
    $W = _IECreateEmbedded()   
    GUICreate("",812, 619) 
    
    GUICtrlCreateObj($W, -1, -1, 812, 619)   
    
    _IENavigate($W, "about:blank") 
    _IENavigate($W "")   
    
    GUISetState(@SW_SHOW)
    AHK:
    Code:
    lbbHandle := DllCall("LoadLibrary", "str", "lbbrowse3.dll")  ; Loads the dll
    
    Gui, Add, Edit, x5 y5 w380 h20 vUrl, truecheaters.com      ;Creates the Edit box in the Gui, Notice "vUrl", v is for variable, Url is the variable name to store the data
    Gui, Add, Button, x+5 w100 h20 gNav, Navigate             ;The button to navigate
    Gui, Show, w500 h400 Center, Example          ;Create the GUI
    WinGet, mainGuiHandle, ID, Example             ;Get the Windows ID to create the browser
    ;Now to call lbbrowse3.dll to create the browser, notice mainGuiHandle is used, the 5 is the x start point, 35 is the y start point, 490 is the width and 380 is the height
    ;Truecheaters.com is the Url to Load up
    ;This is a dll so you will have to declare the variables types. Int for Integer, Str for string.
    DllCall("lbbrowse3\CreateBrowser", "uint", mainGuiHandle, "Int", "5", "Int", "35", "Int", "490", "Int", "380", "Str", "Truecheaters.com")      
    return
    
    Nav:
    Gui, Submit, Nohide     ;Submits the Values in the editbox we made, the Text you input will be stored in the variable Url
    ;Msgbox % "Navigating to " Url
    DllCall("lbbrowse3\Navigate", "str", Url)       ;Navigate function in the .dll   , Str declares the variables as a string, and Url is the address we got from the user.
    return
    this code embeds IE Into a gui , granted the AHK Version written by the great 7USBBALL has controls in it , it is still a fair be more complicated then just using autoit to embed the control.


    I AM STILL ADDING MORE STUFF ITS JUST BED TIME , I PLAN ON ADDING FULL TUTS THIS IS JUST A QUICK AN DIRTY INTRODUCTION, THE TUTS WILL BE MORE CLEANER.
    Last edited by nosnipe; 10-20-2011 at 02:39 AM.
    //not that anyone cares

  2.   Alt These ads help cover server costs and such.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Facebook Bots | Admin Forum