Jump to content

Totally new to autoit...


Zompy
 Share

Recommended Posts

Hey, some of you might know wc3, warcraft 3, well i want to make a single play bot for that, but im wondering how i can make some kind of script for that, sometimes your at the place up, smetimes down, so always making a building at one coordinate doesnt work... Im completely noob :) I did make some little scripts though.

Link to comment
Share on other sites

Hey, some of you might know wc3, warcraft 3, well i want to make a single play bot for that, but im wondering how i can make some kind of script for that, sometimes your at the place up, smetimes down, so always making a building at one coordinate doesnt work... Im completely noob :) I did make some little scripts though.

Yeessh... good luck. I recommend doing some forum searches first. Gamebots aren't exactly easy, especially for a real time strategy game that manipulates resources and makes concious decisions about what needs to do what! Isn't there a product available out there for this already?

Link to comment
Share on other sites

The first step to bot writing in Autoit ofcourse would be to have a general understanding of Autoit.

Understand how variables are used, control structure like while loops, arrays.

After this I would spend sometime writing a simple script using the pixel functions...like pixelsearch.

Write a scrpit that does something, could be to make something move left or right if a certain pixel changes colors.

After you have made a little working script, redesign, rewrite untill you have a good idea of the mechanics.

From here you could scrap pixel searches and directly work with memory, nomadmemory.au3 is a wonderfull tool for botmakers. There are a lot of posts on this site devoted to memory manipulation.

These are a few steps you could follow to start working on your bot.

On a side note, I would think that botmaking for a strategy game would be more difficult that other types of games. I would spend a good amount of time working out what you want it to do and under what circumstances the bot should do this or that.

I like cookies?

Link to comment
Share on other sites

Im busy on another project, but i need your help guys, i cannot figure out how to insert a second thing, like when i type moz it will do something else, help!

; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
$answer = MsgBox(4, "AutoIt Example (English Only)", "Opening the leader project.  Run?")


; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(4096, "AutoIt", "OK.  Bye!")
    Exit
EndIf

; Loop around until the user gives a valid "autoit" answer
$bLoop = 1
While $bLoop = 1
    $text = InputBox("AutoIt Example", "Please enter the program you want to run")
    If @error = 1 Then
        MsgBox(4096, "Error", "You pressed 'Cancel' - try again!")
    Else
       ; They clicked OK, but did they type the right thing?
        If $text <> "TFTB" Then
            MsgBox(4096, "Error", "You typed in the wrong thing - try again!")
        Else
Run the TFT script, removed due size
            $bLoop = 0   ; Exit the loop - ExitLoop would have been an alternative too :)
        EndIf
    EndIf
WEnd

; Print the success message
MsgBox(4096,"AutoIt Example", "You typed in the correct word!  Congrats.")

; Finished!
Link to comment
Share on other sites

Im busy on another project, but i need your help guys, i cannot figure out how to insert a second thing, like when i type moz it will do something else, help!

; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
$answer = MsgBox(4, "AutoIt Example (English Only)", "Opening the leader project.  Run?")


; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(4096, "AutoIt", "OK.  Bye!")
    Exit
EndIf

; Loop around until the user gives a valid "autoit" answer
$bLoop = 1
While $bLoop = 1
    $text = InputBox("AutoIt Example", "Please enter the program you want to run")
    If @error = 1 Then
        MsgBox(4096, "Error", "You pressed 'Cancel' - try again!")
    Else
      ; They clicked OK, but did they type the right thing?
        If $text <> "TFTB" Then
            MsgBox(4096, "Error", "You typed in the wrong thing - try again!")
        Else
Run the TFT script, removed due size
            $bLoop = 0  ; Exit the loop - ExitLoop would have been an alternative too :)
        EndIf
    EndIf
WEnd

; Print the success message
MsgBox(4096,"AutoIt Example", "You typed in the correct word!  Congrats.")

; Finished!
Like this?

; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
$answer = MsgBox(4, "AutoIt Example (English Only)", "Opening the leader project.  Run?")


; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(4096, "AutoIt", "OK.  Bye!")
    Exit
EndIf

; Loop around until the user gives a valid "autoit" answer
$bLoop = 1
While $bLoop = 1
    $text = InputBox("AutoIt Example", "Please enter the program you want to run")
    If @error = 1 Then
        MsgBox(4096, "Error", "You pressed 'Cancel' - try again!")
    Else
       ; They clicked OK, but did they type the right thing?
          Select
               Case $text = "TFTB"
                    ;Run the TFT Script, removed due to size
                    $bLoop = 0   ; Exit the loop - ExitLoop would have been an alternative too :)
               Case $text = "MOZ"
                    ;Do Something Else!
                    $bLoop = 0   ; Exit the loop - ExitLoop would have been an alternative too :)
               Case Else
                    MsgBox(4096, "Error", "You typed in the wrong thing - try again!")
          EndSelect
    EndIf
WEnd

; Print the success message
MsgBox(4096,"AutoIt Example", "You typed in the correct word!  Congrats.")

; Finished!
Link to comment
Share on other sites

I cant find it IN the help file, well, i figured out how it works now :)

SciTE has context sensitive help.

If you type Sleep(100) and put your mouse on the word "sleep" hit F1 and your help file should open with details on that command.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...