Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; https://www.reddit.com/r/ClickerHeroes/comments/36ooi8/sharing_autohotkey_autoclicker_scripts_browser/
- ; Modified by RinArenna May 21, 2015
- ; Modified by Xeno234 Nov 19, 2015
- ; AutoHotkey Version: 1.x
- ; Language: English
- ; Platform: Win9x/NT
- ; Author: CrownFox
- ;
- ; Script Function:
- ; Maximize Returns from Clicker Heroes
- ;
- ;F7 Run the clicker
- ;F8 Stop the clicker
- ;F9 Toggle Hero Level
- ;F10 Toggle Click Speed
- ;F11 Exit the clicker
- #NoEnv ;Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ;Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ;Ensures a consistent starting directory.
- #SingleInstance force ;if script is opened again, replace instance
- #Persistent ;script stays in memory until ExitApp is called or script crashes
- global heroslot := 3
- global leveluphero := false
- global clickdelay := 50 ;Delay after each click
- global multi = 1 ;Regular Speed
- global multialt = 0.5 ;Fast Speed
- global reloaded_n
- ;Setup script title and current state
- global title := "Clicker Heroes"
- global gui := true
- global running := false
- global Count := 0
- ;Setup ability variables
- global abil_1 := true
- global abil_2 := true
- global abil_3 := true
- global abil_4 := true
- global abil_5 := true
- global abil_6 := true
- global abil_7 := true
- global abil_8 := true
- global abil_9 := true
- global abilend_1 := 0
- global abilend_2 := 0
- global abilend_3 := 0
- global abilend_4 := 0
- global abilend_5 := 0
- global abilend_6 := 0
- global abilend_7 := 0
- global abilend_8 := 0
- global abilend_9 := 0
- global abilname_1 := "Clickstorm"
- global abilname_2 := "Powersurge"
- global abilname_3 := "Lucky Strikes"
- global abilname_4 := "Metal Detector"
- global abilname_5 := "Golden Clicks"
- global abilname_6 := "The Dark Ritual"
- global abilname_7 := "Super Clicks"
- global abilname_8 := "Energize"
- global abilname_9 := "Reload"
- global lastabil := 0
- global abilc_1 := 2.5 * 60000
- global abilc_2 := 2.5 * 60000
- global abilc_3 := 7.5 * 60000
- global abilc_4 := 7.5 * 60000
- global abilc_5 := 15 * 60000 + 90200
- global abilc_6 := 120 * 60000
- global abilc_7 := 15 * 60000
- global abilc_8 := 15 * 60000 + 90200
- global abilc_9 := 15 * 60000 + 90200
- Gui,Font,S14 W550,Arial
- Gui,Add,Text,vCPS x0 y5 w250 h40 +Center,Clicks Per Second
- Gui,Font,S25 CDefault Bold,Arial
- Gui,Add,Text,vText x0 y25 w250 h40 +Center,%Count%
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text,x5 y70 w125 h15 +Left,Clickstorm:
- Gui,Add,Text,vTimer1 x120 y70 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text,x5 y85 w125 h15 +Left,Powersurge:
- Gui,Add,Text,vTimer2 x120 y85 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y100 w125 h15 +Left,Lucky Strikes:
- Gui,Add,Text,vTimer3 x120 y100 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y115 w125 h15 +Left,Metal Detector:
- Gui,Add,Text,vTimer4 x120 y115 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y130 w125 h15 +Left,Golden Clicks:
- Gui,Add,Text,vTimer5 x120 y130 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y145 w125 h15 +Left,The Dark Ritual:
- Gui,Add,Text,vTimer6 x120 y145 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y160 w125 h15 +Left,Super Clicks:
- Gui,Add,Text,vTimer7 x120 y160 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y175 w125 h15 +Left,Energize:
- Gui,Add,Text,vTimer8 x120 y175 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y190 w125 h15 +Left,Reload:
- Gui,Add,Text,vTimer9 x120 y190 w125 h15 +Right,Ready
- Gui,Font,S10 CDefault Bold,Arial
- Gui,Add,Text, x5 y210 w125 h15 +Left,Level Hero(F9):
- Gui,Add,Text,vHeroLevel x120 y210 w125 h15 +Right,False
- Gui,Add,Text, x5 y225 w125 h15 +Left,Multiplier(F10):
- Gui,Add,Text,vMulti x120 y225 w125 h15 +Right,1
- Gui,Add,Text, x5 y240 w125 h15 +Left,Running:
- Gui,Add,Text,vRunning x120 y240 w125 h15 +Right,False
- Gui, Show, w250 h265, Tester
- ;The Actual Hotkeys
- ;Run the script
- F7::
- GuiControl,Text,Running,True
- activate(clickdelay)
- return
- F8::
- GuiControl,Text,Running,False
- running := false
- return
- F9::
- if (leveluphero = false)
- {
- GuiControl,Text,HeroLevel,True
- leveluphero := true
- return
- }
- else
- {
- GuiControl,Text,HeroLevel,False
- leveluphero := false
- return
- }
- return
- F10::
- if (multi = 1)
- {
- multi := multialt
- GuiControl,Text,Multi,%multi%
- return
- }
- else
- {
- multi := 1
- GuiControl,Text,Multi,%multi%
- return
- }
- return
- F11::
- ExitApp
- return
- activate(milli)
- {
- starttime := A_TickCount
- Count := 0
- running := true
- SetMouseDelay 0
- SetControlDelay -1
- getWindowAttributes()
- end := 10
- while(running)
- {
- newclickdelay := milli * (multi)
- OutputDebug, %newclickdelay%
- useAbilities(newclickdelay)
- getSkillBonusClickable(newclickdelay)
- getClickables(newclickdelay)
- if(leveluphero) {
- if (i > end)
- {
- levelHero(newclickdelay)
- i = 0
- }
- i++
- }
- if (gui)
- {
- ET := A_TickCount - starttime
- Clicks_Second := Count / (ET / 1000)
- GuiControl,Text,Text,%Clicks_Second%
- r=1
- while (r<10)
- {
- abil := abilend_%r%
- if (abil != 0)
- {
- ET := abil - A_TickCount
- TimeTill := ET / 1000
- GuiControl,Text,Timer%r%,% TimeTill "s"
- }
- else
- {
- GuiControl,Text,Timer%r%,Ready
- }
- r+=1
- }
- if (leveluphero) {
- GuiControl,Text,HeroLevel,True
- }
- else {
- GuiControl,Text,HeroLevel,False
- }
- GuiControl,Text,Multi,%multi%
- if (running)
- {
- GuiControl,Text,Running,True
- }
- else
- {
- GuiControl,Text,Running,False
- }
- }
- sleep newclickdelay
- }
- return
- }
- ;Timer events for abilities
- AbilT_1:
- abil_1 := true
- abilend_1 := 0
- return
- AbilT_2:
- abil_2 := true
- abilend_2 := 0
- return
- AbilT_3:
- abil_3 := true
- abilend_3 := 0
- return
- AbilT_4:
- abil_4 := true
- abilend_4 := 0
- return
- AbilT_5:
- abil_5 := true
- abilend_5 := 0
- return
- AbilT_6:
- abil_6 := true
- abilend_6 := 0
- return
- AbilT_7:
- abil_7 := true
- abilend_7 := 0
- return
- AbilT_8:
- abil_8 := true
- abilend_8 := 0
- return
- AbilT_9:
- abil_9 := true
- abilend_9 := 0
- return
- ReloadedAbilT:
- ControlSend,, %reloaded_n%, %title%
- return
- tryAbility(n, milli) {
- if (abil_%n%) {
- ControlSend,, %n%, %title%
- abil_%n% := false
- if (n = 9) {
- reloaded_n := lastabil
- SetTimer, ReloadedAbilT, -90000
- }
- t := abilc_%n%
- abilend_%n% := A_TickCount + t
- SetTimer, AbilT_%n%, %t%
- lastabil := n
- sleep milli
- }
- }
- useAbilities(milli) {
- tryAbility(1, milli)
- tryAbility(2, milli)
- tryAbility(3, milli)
- tryAbility(4, milli)
- tryAbility(8, milli) ;Double the next Golden Clicker
- tryAbility(5, milli)
- tryAbility(9, milli) ;Use two Golden Clickers
- ; tryAbility(5, milli)
- tryAbility(6, milli)
- tryAbility(7, milli)
- }
- levelHero(milli) {
- ControlSend,, {z down}, %title%
- sleep milli*2
- math := 203 + (104 * (heroslot-1)) + 58
- OutputDebug, y%math%
- ControlClick, x60 y%math%, %title%,,,, NA
- sleep milli*2
- ControlSend,, {z up}, %title%
- sleep milli*2
- }
- getWindowAttributes() {
- SetTitleMatchMode 3 ;Exact Match
- WinActivate %title%
- return
- }
- getSkillBonusClickable(milli) {
- ; click in a sequential area to try to catch mobile clickable
- ControlClick, % "x" 780 " y" 160, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 800 " y" 160, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 880 " y" 160, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 900 " y" 160, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 980 " y" 160, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 1000 " y" 160, %title%,,,, NA
- Count++
- sleep milli
- return
- }
- getClickables(milli) {
- ; clickable positions
- ControlClick, % "x" 515 " y" 490, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 740 " y" 430, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 755 " y" 480, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 755 " y" 370, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 860 " y" 510, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 1000 " y" 455, %title%,,,, NA
- Count++
- sleep milli
- ControlClick, % "x" 1040 " y" 440, %title%,,,, NA
- Count++
- sleep milli
- return
- }
Add Comment
Please, Sign In to add comment