Jump to content
Sign in to follow this  
Zompy

Totally new to autoit...

Recommended Posts

Zompy

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.

Share this post


Link to post
Share on other sites
azure

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?

Share this post


Link to post
Share on other sites
Zompy

Well, i dont want a used program, maybe to learn from, but nothing more, ill search the forum, could you gie me some more info? Thanks for your help

Share this post


Link to post
Share on other sites
Fend

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?

Share this post


Link to post
Share on other sites
Zompy

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!

Share this post


Link to post
Share on other sites
azure

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!

Share this post


Link to post
Share on other sites
Zompy

Oh, i gonna test that out right now! ill post later!

Share this post


Link to post
Share on other sites
Zompy

It works! Thanks so much :):lmao:

edit: how to mkae random delays?

Edited by Zompy

Share this post


Link to post
Share on other sites
azure

It works! Thanks so much :):lmao:

edit: how to mkae random delays?

Please keep in the forum unless I ask you to PM me.

Using the random function.

Sleep(Random(10,100,1)*10)

Share this post


Link to post
Share on other sites
Zompy

Alright, im sorry, i don't understand that code, what is the delay in here? why the *10?

Share this post


Link to post
Share on other sites
azure

Alright, im sorry, i don't understand that code, what is the delay in here? why the *10?

Use the help file please.

Share this post


Link to post
Share on other sites
azure

Cant find it...

Can't find what? The help file?

Start, Programs, AutoIt v3, autoIt Help File

Or "C:\Program Files\AutoIt3\AutoIt.chm"

Share this post


Link to post
Share on other sites
Zompy

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

Share this post


Link to post
Share on other sites
azure

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.

Share this post


Link to post
Share on other sites
Zompy

Ok thanks, ill focuz os somthing with pixels now, trying to find out how it works :)

Share this post


Link to post
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
Sign in to follow this  

×