Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Clicker Heroes Steam Version Bot
- ; Version: 0.1
- ; Date: 5/27/2015
- ; Author: FlyinPoulpus
- ; This script will auto-click the Clicker Heroes game window while attempting
- ; to collect all "clickables" (currently Easter Eggs) including the moving one.
- ; It will also round through the skills and perform the dark ritual combo every time
- ; your energize/reload combo is available. When the damaging skills are activated,
- ; the script try to reactivate autoprogress mode. This option must only be used if you know you'll
- ; only progress to the next five zones with the use of this skills. It can be counterproductive if you
- ; instakill everything.
- ; At last, it will autolevel Treebeast, Ivan and Brittany automatically. Every X loop (with X = candyPeriodCheck)
- ; the script will click once on the leveling button for each hero. This will be improved in later version
- ; (level only one hero or more? I'll have to decide)
- ;
- ; Instructions:
- ; - Run .ahk file
- ; - F2 : enable or disable skills use (default: enabled)
- ; - F4 : enable or disable autoprogress use (default: enabled)
- ; - F6 : enable or disable hero leveling (default: enabled)
- ; - F7 : starts the bot
- ; - F8 : stops the bot
- ; - F12 : exit the bot
- ;
- ; Change "timing" variable to suit your needs if the script is running too fast or slow.
- ;
- ; Additions in 0.3:
- ; - Improved skills use to perform the dark ritual combo. The timing between two combos
- ; can be configured by the user
- ; - The script will now regularly reactivate auto progress mode every time it uses the
- ; damage skills. This will allow you to progress the furthest possible. DO NOT use this
- ; if you instakill everything since it will deactivate autoprogress each time a DR combi is called
- ; - All the above additions were made optional through config variables. Just set what you
- ; want to use to true.
- ;
- ; TODO :
- ; - Improve skills use (double damage/critical strikes could be used more often)
- ; - Improve hero leveling
- #SingleInstance force ; if script is opened again, replace instance
- #Persistent ; script stays in memory until ExitApp is called or script crashes
- ; ================================================================================================================
- ; Configuration variables section
- global title := "Clicker Heroes" ; we will exact match against this for steam version
- global stop := false
- ; pass in the duration to wait between two dark ritual combos. Default value is 905K, aka 15 minutes
- ; + a safety delay of 5 seconds, which is the time required between two energize/reload
- ; when Vaargur is maxed out
- skillsCooldown := 900000
- ; determine how often the script will click on the candies possible spawning location (the lower
- ; the number, the more it'll check...)
- candyPeriodCheck := 25
- ; change this value to adjust script speed (milliseconds), must be a multiple of 10, the lower the faster
- ; 600 seems to be the best value for steam. You can use lower value but the game gets laggy.
- timing := 400
- global useSkills := true
- global autoProgress := true
- global autoLevelHeroes := true
- ; ================================================================================================================
- ; ================================================================================================================
- ; Key configuration section
- ; F2: toggle skill use
- F2::
- useSkills := !useSkills
- return
- ; F4: toggle autoprogress
- F4::
- autoProgress := !autoProgress
- return
- ; F6: toggle hero leveling
- F6::
- autoLevelHeroes := !autoLevelHeroes
- return
- ; F7: uses everything (clickables, leveling heroes, autoprogress, DR Combo)
- F7::
- MainLoop(skillsCooldown, timing, candyPeriodCheck)
- return
- ; F8 will pause the auto-clicker
- F8::
- stop := true
- return
- ; F10 will exit the script entirely
- F10::
- ExitApp
- return
- ; ================================================================================================================
- ; ================================================================================================================
- ; Logic section
- MainLoop(skillsCooldown, timing, candyPeriodCheck)
- {
- stop := false
- SetMouseDelay 0
- SetControlDelay -1
- maxLoops := ceil(skillsCooldown / timing) ; number of loops corresponding to the skills cooldown
- drAlreadyActivated := false ; Dark ritual flag (allows to circle between the two DR combo sequence
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === MainLoop began `n, logs.txt
- GetWindowAttributes()
- i := 0
- while(!stop)
- {
- ClickFlyingBugArea(timing)
- ; If DRCombo option is set and skills have been reloaded, launching appropriate combo
- if(i > maxLoops && useSkills)
- {
- if(!drAlreadyActivated)
- {
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === Sending first combo`n, logs.txt
- UseDamagingAbilities()
- UseEnergizeDRReload()
- drAlreadyActivated := true
- }
- else
- {
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === Sending second combo`n, logs.txt
- UseEnergizeReload()
- UseDamagingAbilities()
- drAlreadyActivated := false
- }
- i := 0
- }
- ; Every cendyPeriodCheck loop, levels hero (if activated) and checks for candies
- if( mod(i, candyPeriodCheck) = 0 )
- {
- if( autoLevelHeroes )
- {
- ControlClick, % "x" 60 " y" 360, %title%,,,, NA
- ControlClick, % "x" 60 " y" 470, %title%,,,, NA
- ControlClick, % "x" 60 " y" 570, %title%,,,, NA
- }
- ClickCandiesLocations()
- }
- i++
- }
- return
- }
- GetWindowAttributes()
- {
- SetTitleMatchMode 3 ; window title contains the string supplied
- WinActivate %title%
- return
- }
- UseDamagingAbilities()
- {
- ControlSend,, 2, %title%
- ControlSend,, 3, %title%
- ControlSend,, 4, %title%
- ControlSend,, 5, %title%
- ControlSend,, 7, %title%
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === Sent damaging abilites`n, logs.txt
- if( autoProgress )
- {
- enableAutoProgress()
- }
- return
- }
- UseEnergizeReload()
- {
- ControlSend,, 8, %title%
- ControlSend,, 9, %title%
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === Sent EN + Reload `n, logs.txt
- return
- }
- UseEnergizeDRReload()
- {
- ControlSend,, 8, %title%
- ControlSend,, 6, %title%
- ControlSend,, 9, %title%
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === Sent full DR combo `n, logs.txt
- return
- }
- EnableAutoProgress()
- {
- ControlSend,, A, %title%
- FileAppend, %A_Hour%:%A_Min%:%A_Sec% === Sent autoprogress`n, logs.txt
- return
- }
- ; Clicks on the top of the screen where the flying bug can appear.
- ; If no bug is here, will still damage the main mob.
- ; Sleeps a bit between each click to smooth the visual result (less stress for the game)
- ClickFlyingBugArea(timing)
- {
- clickNumber := 10
- clickDelay := floor( timing / 10 )
- Loop, %clickNumber%
- {
- x_coord := 800 + ( 20 * A_Index )
- ControlClick, % "x" x_coord " y" 160, %title%,,,, NA
- Sleep clickDelay
- }
- return
- }
- ; Clicks on the 6 possible spawn location for candies
- ClickCandiesLocations()
- {
- ControlClick, % "x" 527 " y" 486, %title%,,,, NA
- ControlClick, % "x" 751 " y" 432, %title%,,,, NA
- ControlClick, % "x" 758 " y" 380, %title%,,,, NA
- ControlClick, % "x" 871 " y" 510, %title%,,,, NA
- ControlClick, % "x" 1004 " y" 453, %title%,,,, NA
- ControlClick, % "x" 1057 " y" 444, %title%,,,, NA
- return
- }
- ; ================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement