Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Clicker Heroes Steam Version AutoHotkey script
- ; Version: 0.2
- ; Date: 5/16/2015
- ; Author: Andrux51 (http://github.com/Andrux51)
- ;
- ; This script will auto-click the Clicker Heroes game window while attempting
- ; to collect all "clickables" (currently Easter Eggs) including the moving one.
- ; The clicks per second should average roughly 50 consistently.
- ; (browser version... steam version avg. cps unknown)
- ; Other scripts may spike higher (I got as high as 90) but that is inconsistent.
- ;
- ; The script will not attempt to use skills in this version.
- ; These features may be added in the future but are not a priority for now.
- ;
- ; Instructions:
- ; - Run .ahk file
- ; - F7 will begin (and resume when paused) the clicker
- ; - F8 will pause the clicker
- ; - F9 will run at 1/4 speed (makes it easier to click for levels etc)
- ; - F10 will exit the script entirely
- ; - F11 will level the 4th character in the list (same position as Brittany by default)
- ;
- ; Change "timing" variable to suit your needs if the script is running too fast or slow.
- ;
- #SingleInstance force ; if script is opened again, replace instance
- #Persistent ; script stays in memory until ExitApp is called or script crashes
- global title := "Clicker Heroes" ; we will exact match against this for steam version
- global stop := false
- ; change this value to adjust script speed (milliseconds)
- global timing := 150
- ; pass in frequency to check for clickables
- ; ; higher number means more clicks on moving clickable, less often for other clickables
- global frequency := 0
- ; F7 will begin/resume the auto-clicker
- F7::
- frequency := 50
- slacktivate(timing, frequency, false)
- return
- ; F11 will begin/resume the auto-clicker and level the 4th hero on the list
- F11::
- frequency := 15
- slacktivate(timing, frequency, true)
- return
- ; F8 will pause the auto-clicker
- F8::
- stop := true
- return
- ; F9 will allow for time to buy guys/skills etc without losing combo
- F9::
- frequency := 1
- slacktivate(timing * 4, frequency, false)
- return
- ; F10 will exit the script entirely
- F10::
- ExitApp
- return
- ; pass in milliseconds to adjust click speed
- slacktivate(milli, p, levelup) {
- stop := false
- SetMouseDelay 0
- SetControlDelay -1
- ; We get the title match for the Clicker Heroes game window
- getWindowAttributes()
- i = 0
- ; Send clicks to CH while the script is active (press F8 to stop)
- while(!stop) {
- ; try to catch skill bonus clickable
- ; high priority- this requires a lot of focused clicks
- getSkillBonusClickable()
- ; low priority- other clickables are moderately rare
- if(i > p) {
- ; try to get other clickables
- getClickables()
- ; use abilities to power up
- useAbilities()
- ; if the script is set to level up the hero, do that here (25x)
- if(levelup) {
- levelGildedHero()
- }
- i = 0
- }
- i++
- Sleep milli
- }
- return
- }
- getWindowAttributes() {
- SetTitleMatchMode 3 ; window title contains the string supplied
- ; Activate window that contains Clicker Heroes
- WinActivate %title%
- return
- }
- levelGildedHero() {
- ControlSend,, {z down}, %title%
- Sleep 10
- ControlClick, % "x" 60 " y" 600, %title%,,,, NA
- ControlSend,, {z up}, %title%
- Sleep 10
- return
- }
- useAbilities() {
- ; TODO: use abilities at more appropriate times
- ; due to the speed of this script, Clickstorm becomes almost useless
- ; let's use it anyway just to be pressing buttons!
- ControlSend,, 1, %title%
- ; use Powersurge
- ControlSend,, 2, %title%
- ; use Lucky Strikes
- ControlSend,, 3, %title%
- ; use Super Clicks
- ControlSend,, 7, %title%
- ; use Metal Detector
- ControlSend,, 4, %title%
- ; use Golden Clicks
- ControlSend,, 5, %title%
- ; use Reload (best after Golden Clicks or Lucky Strikes?)
- ControlSend,, 9, %title%
- return
- }
- getSkillBonusClickable() {
- ; click in a sequential area to try to catch mobile clickable
- ControlClick, % "x" 780 " y" 160, %title%,,,, NA
- ControlClick, % "x" 800 " y" 160, %title%,,,, NA
- ControlClick, % "x" 880 " y" 160, %title%,,,, NA
- ControlClick, % "x" 900 " y" 160, %title%,,,, NA
- ControlClick, % "x" 980 " y" 160, %title%,,,, NA
- ControlClick, % "x" 1000 " y" 160, %title%,,,, NA
- return
- }
- getClickables() {
- ; clickable positions
- ControlClick, % "x" 515 " y" 490, %title%,,,, NA
- ControlClick, % "x" 740 " y" 430, %title%,,,, NA
- ControlClick, % "x" 755 " y" 480, %title%,,,, NA
- ControlClick, % "x" 755 " y" 370, %title%,,,, NA
- ControlClick, % "x" 860 " y" 510, %title%,,,, NA
- ControlClick, % "x" 1000 " y" 455, %title%,,,, NA
- ControlClick, % "x" 1040 " y" 440, %title%,,,, NA
- return
- }
Add Comment
Please, Sign In to add comment