LossBot Tutorial From Blub, In AutoIt

This is a discussion on LossBot Tutorial From Blub, In AutoIt within the Warcraft 3 forum board part of the Hot Games category; This is made by Blub from SkillHackerz, i just copy/pasted it ! Welcome to my tut „code your own Warcraft ...

Results 1 to 3 of 3
  1. #1
    xiN
    xiN is offline Guess who's back ?
    Array
    Join Date
    Feb 2007
    Location
    Six feet under
    Posts
    1,580
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    358

    LossBot Tutorial From Blub, In AutoIt

    This is made by Blub from SkillHackerz, i just copy/pasted it !

    Welcome to my tut „code your own Warcraft III solo Lossbot with autoit“

    What do you need for it?
    -Warcraft III (has to be active window while lossbot is running!)
    -AutoIt v3
    -low autoit skills( you need to know what a function, a loop and a variable is…)

    I try to make this as easy as possible to understand this.
    Please read the whole tutorial before you try your own script.

    1. Theory:
    A Lossbot does same actions like a human player. But the advantage is that you don’t have to click/press all the time, you can be afk and its many times faster than a human could ever click/press.

    So we start very simply smile.gif

    What do you do if you want to start a game?
    Right, you click on quick game.
    My wc3 is German, so I do all the hotkeys of the German version.
    Hotkey for German quick game is ALT+I.
    At first we need to know, which Autoit function supports our simulation….

    QUOTE(autoit helpfile)
    Code:
    Send
    Sends simulated keystrokes to the active window.
    Send ( "keys" [, flag] )
    So the first idea is that it will look like
    Code:
    Send(“!i”)

    After we have found an enemy in solo game, we need to leave.
    There are to possibilities.

    1. Press F10 (open menu)
    Press e (press leave game option -> opens quit window)
    PressALT+ b (press quit mission)
    2. press ALT + Q(opens quit window)
    press ALT+ b (press quit mission)

    if you use ALT+b or b doesn’t care, you will leave in both ways, but b only will be sent to chat, so we use ALT+b.

    so, now we have left the game.

    We are now at the screen where the score table is. Press enter and you will get out of it.

    So the theory is done smile.gif



    2. The Autoit code

    So far our code would look like
    Code:
    send("!i");start quick game
    
    send("!q"); opens leave menu
    send("!b") ; quits mission
    
    send("{enter}");leaves out of the score table
    BUT!! After you start this script it will run just once and close itself!
    So we need to put in a while loop
    QUOTE(autoit helpfile)
    While...WEnd
    Loop based on an expression.
    While <expression>
    statements
    ...
    WEnd


    With the while loop our new code looks so:



    Code:
    While true
    send("!i");start quickgame
    
    send("!q"); opens leave menue
    send("!b") ; quits mission
    
    send("{enter}");leaves out of the scoretable
    Wend


    But again a problem… the loop runs all the time, that’s good, but how can I close this loop?
    You need a hotkey and a variable.
    QUOTE(autoti helpfile)
    HotKeySet

    Sets a hotkey that calls a user function.
    Code:
    HotKeySet ( "key" [, "function"] )

    We use the hotkey F8 to start and hotkey F9 to stop and create a new function to make start and stop possible.
    To prevent that the script will end we need to put in an idling loop.
    For idling we need the sleep function.
    QUOTE(autoit hepfile)
    Sleep
    Pause script execution.
    Sleep (delay in milliseconds)
    Remember: 1000 ms = 1 sec!

    An idling loops looks so:
    Code:
    while 1
    sleep(10)
    wend
    To stop and start the lossbot we need our while loop with the leave commands as a function for making able to call it every time.
    we also add the hotkey F10 as the hotkey to close the lossbot.

    Code:
    Global $stop;the variable for start / stop, has to be declared at the beginning
    
    Hotkeyset("{F8}","go") ;starthotkey
    Hotkeyset("{F9}","stop");stophotkey
    hotkeyset("{F10}","exit"); shuts the lossbot down
    
    Func Lossbot()
    While $stop > 2;starts loop
    
    send("!i");start quickgame
    
    send("!q"); opens leave menue
    
    send("!b") ; quits mission
    
    send("{enter}");leaves out of the scoretable
    
    Wend;ends loop
    EndFunc
    
    while 1      ;the idling loop that the program wont close
        sleep(10)
        WEnd
    
    func go()       ;function to start the bot
        $stop = 3   ; if stop > 2       loop will be done until stop hotkey will be pressed
        Lossbot()
    EndFunc
    
    func stop()  ; function to stop the bot
        $stop = 1;if stop < 2      loop will run until the end and func lossbot will end too.
    EndFunc
    
    func exit()  ;closes the lossbot, i think it speaks for itself :)
        MsgBox(0,"","Lossbot closed")
        Exit
    Endfunc


    We are nearly finished smile.gif

    Just one small problem. My lossbot is leaving instantly, but I want that it leaves after the other lossbots in my 1on1, how can I make this?

    We need to put again a sleep time. But this time in the while loop. I think the best position for the sleep time is between opening leave window and the leaving.

    Our last code will look so:
    Code:
    Global $stop;the variable for start / stop, has to be declared at the beginning
    
    Hotkeyset("{F8}","go") ;starthotkey
    Hotkeyset("{F9}","stop");stophotkey
    hotkeyset("{F10}","exit"); shuts the lossbot down
    
    Func Lossbot()
    While $stop > 2;starts loop
    
    send("!i");start quickgame
    
    send("!q"); opens leave menue
    
    sleep(2000);2 sec delay before lossbot will leave
    
    send("!b") ; quits mission
    
    send("{enter}");leaves out of the scoretable
    
    Wend;ends loop
    EndFunc
    
    while 1      ;the idling loop that the program wont close
        sleep(10)
        WEnd
    
    func go()       ;function to start the bot
        $stop = 3   ; if stop > 2 ==> loop will be done until stop hotkey will be pressed
        Lossbot()
    EndFunc
    
    func stop()  ; function to stop the bot
        $stop = 1;if stop < 2 ==> loop will run until the end and func lossbot will end too.
    EndFunc
    
    func exit()  ;closes the lossbot, i think it speaks for itself :)
        MsgBox(0,"","Lossbot closed")
        Exit
    Endfunc
    Enjoy now !
    Last edited by xiN; 11-04-2007 at 01:05 PM.

  2. #2
    GodOfWar is offline Banned User Array
    Join Date
    Jul 2007
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    250
    Thanks mate :O (This was made by Blub)
    Last edited by GodOfWar; 11-04-2007 at 01:06 PM.

  3. #3
    xiN
    xiN is offline Guess who's back ?
    Array
    Join Date
    Feb 2007
    Location
    Six feet under
    Posts
    1,580
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    358
    np :p
    Last edited by xiN; 11-04-2007 at 01:36 PM.

Similar Threads

  1. Blub lossbot prob!
    By Velocity in forum Warcraft 3 forum
    Replies: 6
    Last Post: 09-17-2009, 09:23 PM
  2. A custom quest tutorial.
    By Batman in forum WoW Private Servers
    Replies: 13
    Last Post: 07-29-2008, 05:13 PM
  3. Bobbert's LossBot Tutorial
    By Bobbert in forum Warcraft 3 forum
    Replies: 6
    Last Post: 08-16-2007, 09:27 PM
  4. AutoIt LossBot
    By PlayerH in forum Development
    Replies: 0
    Last Post: 05-16-2007, 04:40 PM
  5. [Tool] AutoIt v3
    By tschoerk in forum Operating Systems
    Replies: 6
    Last Post: 03-24-2007, 09:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •