NJ5SkwAg

Modification to no ascension script

Nov 19th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; https://www.reddit.com/r/ClickerHeroes/comments/36ooi8/sharing_autohotkey_autoclicker_scripts_browser/
  2. ; Modified by RinArenna May 21, 2015
  3. ; Modified by Xeno234 Nov 19, 2015
  4.  
  5.  
  6. ; AutoHotkey Version: 1.x
  7. ; Language:       English
  8. ; Platform:       Win9x/NT
  9. ; Author:         CrownFox
  10. ;
  11. ; Script Function:
  12. ;   Maximize Returns from Clicker Heroes
  13. ;
  14. ;F7 Run the clicker
  15. ;F8 Stop the clicker
  16. ;F9 Toggle Hero Level
  17. ;F10 Toggle Click Speed
  18. ;F11 Exit the clicker
  19.  
  20. #NoEnv  ;Recommended for performance and compatibility with future AutoHotkey releases.
  21. SendMode Input  ;Recommended for new scripts due to its superior speed and reliability.
  22. SetWorkingDir %A_ScriptDir%  ;Ensures a consistent starting directory.
  23. #SingleInstance force ;if script is opened again, replace instance
  24. #Persistent ;script stays in memory until ExitApp is called or script crashes
  25.  
  26. global heroslot := 3
  27. global leveluphero := false
  28.  
  29. global clickdelay := 50 ;Delay after each click
  30. global multi = 1 ;Regular Speed
  31. global multialt = 0.5 ;Fast Speed
  32.  
  33. global reloaded_n
  34.  
  35. ;Setup script title and current state
  36. global title := "Clicker Heroes"
  37. global gui := true
  38. global running := false
  39. global Count := 0
  40.  
  41. ;Setup ability variables
  42.  
  43. global abil_1 := true
  44. global abil_2 := true
  45. global abil_3 := true
  46. global abil_4 := true
  47. global abil_5 := true
  48. global abil_6 := true
  49. global abil_7 := true
  50. global abil_8 := true
  51. global abil_9 := true
  52.  
  53. global abilend_1 := 0
  54. global abilend_2 := 0
  55. global abilend_3 := 0
  56. global abilend_4 := 0
  57. global abilend_5 := 0
  58. global abilend_6 := 0
  59. global abilend_7 := 0
  60. global abilend_8 := 0
  61. global abilend_9 := 0
  62.  
  63. global abilname_1 := "Clickstorm"
  64. global abilname_2 := "Powersurge"
  65. global abilname_3 := "Lucky Strikes"
  66. global abilname_4 := "Metal Detector"
  67. global abilname_5 := "Golden Clicks"
  68. global abilname_6 := "The Dark Ritual"
  69. global abilname_7 := "Super Clicks"
  70. global abilname_8 := "Energize"
  71. global abilname_9 := "Reload"
  72.  
  73.  
  74. global lastabil := 0
  75.  
  76. global abilc_1 := 2.5 * 60000
  77. global abilc_2 := 2.5 * 60000
  78. global abilc_3 := 7.5 * 60000
  79. global abilc_4 := 7.5 * 60000
  80. global abilc_5 := 15 * 60000 + 90200
  81. global abilc_6 := 120 * 60000
  82. global abilc_7 := 15 * 60000
  83. global abilc_8 := 15 * 60000 + 90200
  84. global abilc_9 := 15 * 60000 + 90200
  85.  
  86. Gui,Font,S14 W550,Arial
  87. Gui,Add,Text,vCPS x0 y5 w250 h40 +Center,Clicks Per Second
  88.  
  89. Gui,Font,S25 CDefault Bold,Arial
  90. Gui,Add,Text,vText x0 y25 w250 h40 +Center,%Count%
  91.  
  92. Gui,Font,S10 CDefault Bold,Arial
  93. Gui,Add,Text,x5 y70 w125 h15 +Left,Clickstorm:
  94. Gui,Add,Text,vTimer1 x120 y70 w125 h15 +Right,Ready
  95.  
  96. Gui,Font,S10 CDefault Bold,Arial
  97. Gui,Add,Text,x5 y85 w125 h15 +Left,Powersurge:
  98. Gui,Add,Text,vTimer2 x120 y85 w125 h15 +Right,Ready
  99.  
  100. Gui,Font,S10 CDefault Bold,Arial
  101. Gui,Add,Text, x5 y100 w125 h15 +Left,Lucky Strikes:
  102. Gui,Add,Text,vTimer3 x120 y100 w125 h15 +Right,Ready
  103.  
  104. Gui,Font,S10 CDefault Bold,Arial
  105. Gui,Add,Text, x5 y115 w125 h15 +Left,Metal Detector:
  106. Gui,Add,Text,vTimer4 x120 y115 w125 h15 +Right,Ready
  107.  
  108. Gui,Font,S10 CDefault Bold,Arial
  109. Gui,Add,Text, x5 y130 w125 h15 +Left,Golden Clicks:
  110. Gui,Add,Text,vTimer5 x120 y130 w125 h15 +Right,Ready
  111.  
  112. Gui,Font,S10 CDefault Bold,Arial
  113. Gui,Add,Text, x5 y145 w125 h15 +Left,The Dark Ritual:
  114. Gui,Add,Text,vTimer6 x120 y145 w125 h15 +Right,Ready
  115.  
  116. Gui,Font,S10 CDefault Bold,Arial
  117. Gui,Add,Text, x5 y160 w125 h15 +Left,Super Clicks:
  118. Gui,Add,Text,vTimer7 x120 y160 w125 h15 +Right,Ready
  119.  
  120. Gui,Font,S10 CDefault Bold,Arial
  121. Gui,Add,Text, x5 y175 w125 h15 +Left,Energize:
  122. Gui,Add,Text,vTimer8 x120 y175 w125 h15 +Right,Ready
  123.  
  124. Gui,Font,S10 CDefault Bold,Arial
  125. Gui,Add,Text, x5 y190 w125 h15 +Left,Reload:
  126. Gui,Add,Text,vTimer9 x120 y190 w125 h15 +Right,Ready
  127.  
  128. Gui,Font,S10 CDefault Bold,Arial
  129. Gui,Add,Text, x5 y210 w125 h15 +Left,Level Hero(F9):
  130. Gui,Add,Text,vHeroLevel x120 y210 w125 h15 +Right,False
  131. Gui,Add,Text, x5 y225 w125 h15 +Left,Multiplier(F10):
  132. Gui,Add,Text,vMulti x120 y225 w125 h15 +Right,1
  133. Gui,Add,Text, x5 y240 w125 h15 +Left,Running:
  134. Gui,Add,Text,vRunning x120 y240 w125 h15 +Right,False
  135.  
  136. Gui, Show, w250 h265, Tester
  137.  
  138. ;The Actual Hotkeys
  139.  
  140. ;Run the script
  141. F7::
  142.     GuiControl,Text,Running,True
  143.     activate(clickdelay)
  144.     return
  145.    
  146. F8::
  147.     GuiControl,Text,Running,False
  148.     running := false
  149.     return
  150.    
  151. F9::
  152.     if (leveluphero = false)
  153.     {
  154.         GuiControl,Text,HeroLevel,True
  155.         leveluphero := true
  156.         return
  157.     }
  158.     else
  159.     {
  160.         GuiControl,Text,HeroLevel,False
  161.         leveluphero := false
  162.         return
  163.     }
  164.     return
  165.    
  166. F10::
  167.     if (multi = 1)
  168.     {
  169.         multi := multialt
  170.         GuiControl,Text,Multi,%multi%
  171.         return
  172.     }
  173.     else
  174.     {
  175.         multi := 1
  176.         GuiControl,Text,Multi,%multi%
  177.         return
  178.     }
  179.     return
  180.  
  181.    
  182.  
  183.    
  184. F11::
  185.     ExitApp
  186.     return
  187.  
  188. activate(milli)
  189. {
  190.     starttime := A_TickCount
  191.     Count := 0
  192.     running := true
  193.     SetMouseDelay 0
  194.     SetControlDelay -1
  195.     getWindowAttributes()
  196.     end := 10
  197.    
  198.     while(running)
  199.     {
  200.         newclickdelay := milli * (multi)
  201.         OutputDebug, %newclickdelay%
  202.         useAbilities(newclickdelay)
  203.         getSkillBonusClickable(newclickdelay)
  204.         getClickables(newclickdelay)
  205.        
  206.         if(leveluphero) {
  207.             if (i > end)
  208.             {
  209.                 levelHero(newclickdelay)
  210.                 i = 0
  211.             }
  212.            
  213.         i++
  214.         }
  215.        
  216.         if (gui)
  217.         {
  218.             ET := A_TickCount - starttime
  219.             Clicks_Second := Count / (ET / 1000)
  220.             GuiControl,Text,Text,%Clicks_Second%
  221.            
  222.             r=1
  223.             while (r<10)
  224.             {
  225.                 abil := abilend_%r%
  226.                 if (abil != 0)
  227.                 {
  228.                     ET := abil - A_TickCount
  229.                     TimeTill := ET / 1000
  230.                     GuiControl,Text,Timer%r%,% TimeTill "s"
  231.                 }
  232.                 else
  233.                 {
  234.                     GuiControl,Text,Timer%r%,Ready
  235.                 }
  236.                 r+=1
  237.             }
  238.            
  239.             if (leveluphero) {
  240.                 GuiControl,Text,HeroLevel,True
  241.             }
  242.             else {
  243.                 GuiControl,Text,HeroLevel,False
  244.             }
  245.            
  246.             GuiControl,Text,Multi,%multi%
  247.            
  248.             if (running)
  249.             {
  250.                 GuiControl,Text,Running,True
  251.             }
  252.             else
  253.             {
  254.                 GuiControl,Text,Running,False
  255.             }
  256.         }  
  257.        
  258.         sleep newclickdelay
  259.     }
  260.    
  261.     return
  262. }
  263.    
  264.    
  265.  
  266. ;Timer events for abilities
  267. AbilT_1:
  268.     abil_1 := true
  269.     abilend_1 := 0
  270. return
  271.  
  272. AbilT_2:
  273.     abil_2 := true
  274.     abilend_2 := 0
  275. return
  276.  
  277. AbilT_3:
  278.     abil_3 := true
  279.     abilend_3 := 0
  280. return
  281.  
  282. AbilT_4:
  283.     abil_4 := true
  284.     abilend_4 := 0
  285. return
  286.  
  287. AbilT_5:
  288.     abil_5 := true
  289.     abilend_5 := 0
  290. return
  291.  
  292. AbilT_6:
  293.     abil_6 := true
  294.     abilend_6 := 0
  295. return
  296.  
  297. AbilT_7:
  298.     abil_7 := true
  299.     abilend_7 := 0
  300. return
  301.  
  302. AbilT_8:
  303.     abil_8 := true
  304.     abilend_8 := 0
  305. return
  306.  
  307. AbilT_9:
  308.     abil_9 := true
  309.     abilend_9 := 0
  310. return
  311.  
  312. ReloadedAbilT:
  313.     ControlSend,, %reloaded_n%, %title%
  314. return
  315.  
  316. tryAbility(n, milli) {
  317.     if (abil_%n%) {
  318.         ControlSend,, %n%, %title%
  319.         abil_%n% := false
  320.         if (n = 9) {
  321.             reloaded_n := lastabil
  322.             SetTimer, ReloadedAbilT, -90000
  323.         }
  324.         t := abilc_%n%
  325.         abilend_%n% := A_TickCount + t
  326.         SetTimer, AbilT_%n%, %t%
  327.         lastabil := n
  328.         sleep milli
  329.     }
  330. }
  331.  
  332. useAbilities(milli) {
  333.     tryAbility(1, milli)
  334.     tryAbility(2, milli)
  335.     tryAbility(3, milli)
  336.     tryAbility(4, milli)
  337.    
  338.     tryAbility(8, milli) ;Double the next Golden Clicker
  339.     tryAbility(5, milli)
  340.     tryAbility(9, milli) ;Use two Golden Clickers
  341.     ; tryAbility(5, milli)
  342.  
  343.     tryAbility(6, milli)
  344.     tryAbility(7, milli)
  345. }
  346.  
  347. levelHero(milli) {
  348.     ControlSend,, {z down}, %title%
  349.     sleep milli*2
  350.    
  351.     math := 203 + (104 * (heroslot-1)) + 58
  352.     OutputDebug, y%math%
  353.    
  354.     ControlClick, x60 y%math%, %title%,,,, NA
  355.     sleep milli*2
  356.    
  357.     ControlSend,, {z up}, %title%
  358.     sleep milli*2
  359. }
  360.  
  361. getWindowAttributes() {
  362.     SetTitleMatchMode 3 ;Exact Match
  363.     WinActivate %title%
  364.     return
  365. }
  366.  
  367. getSkillBonusClickable(milli) {
  368.     ; click in a sequential area to try to catch mobile clickable
  369.     ControlClick, % "x" 780 " y" 160, %title%,,,, NA
  370.     Count++
  371.     sleep milli
  372.     ControlClick, % "x" 800 " y" 160, %title%,,,, NA
  373.     Count++
  374.     sleep milli
  375.     ControlClick, % "x" 880 " y" 160, %title%,,,, NA
  376.     Count++
  377.     sleep milli
  378.     ControlClick, % "x" 900 " y" 160, %title%,,,, NA
  379.     Count++
  380.     sleep milli
  381.     ControlClick, % "x" 980 " y" 160, %title%,,,, NA
  382.     Count++
  383.     sleep milli
  384.     ControlClick, % "x" 1000 " y" 160, %title%,,,, NA
  385.     Count++
  386.     sleep milli
  387.     return
  388. }
  389.  
  390. getClickables(milli) {
  391.     ; clickable positions
  392.     ControlClick, % "x" 515 " y" 490, %title%,,,, NA
  393.     Count++
  394.     sleep milli
  395.     ControlClick, % "x" 740 " y" 430, %title%,,,, NA
  396.     Count++
  397.     sleep milli
  398.     ControlClick, % "x" 755 " y" 480, %title%,,,, NA
  399.     Count++
  400.     sleep milli
  401.     ControlClick, % "x" 755 " y" 370, %title%,,,, NA
  402.     Count++
  403.     sleep milli
  404.     ControlClick, % "x" 860 " y" 510, %title%,,,, NA
  405.     Count++
  406.     sleep milli
  407.     ControlClick, % "x" 1000 " y" 455, %title%,,,, NA
  408.     Count++
  409.     sleep milli
  410.     ControlClick, % "x" 1040 " y" 440, %title%,,,, NA
  411.     Count++
  412.     sleep milli
  413.     return
  414. }
Add Comment
Please, Sign In to add comment