Guest User

Untitled

a guest
Jul 4th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.03 KB | None | 0 0
  1. ; -----------------------------------------------------------------------------------------
  2. ; Clicker Heroes HS Speed Farmer
  3. ; v1.8
  4. ; by Sw1ftb
  5.  
  6. ; Note that this bot is not intended for the early game!
  7. ; It assumes that your Iris ancient level is high enough to (after an ascension + clickable)
  8. ; instantly unlock and level all heroes, including Frostleaf, to 100 and buy all upgrades.
  9. ; The goal is to speed run around 1000 levels (starting from your Iris level) in 30-35 minutes and then restart.
  10.  
  11. ; How to get millions of Hero Souls?
  12.  
  13. ; 1. Select Steam or browser support with the SetTitleMatchMode parameter.
  14. ; - If Steam, make sure you run in windowed mode at default size (1136 x 640).
  15. ; - If browser, follow the instructions below for setting the correct top margin.
  16. ; 2. Scroll down to the Hotkeys section and run the "Quick initial tests".
  17. ; 3. If those works, go back up and adjust the Coordinates > initRun function settings.
  18. ; Some tinkering might be needed if you are at a later stage in the game than me.
  19. ; 4. When that bit work, go back up and configure your Speed run.
  20. ; Adjust the irisLevel and gildedRanger settings. Leave the rest as is and hit Ctrl+F1!
  21. ; Important! The script assumes that you have just ascended with a "clickable" available and in Farm Mode.
  22. ; 5. If everything works you should end up with a "Salvage Junk Pile & Ascend?" question after ~30 minutes.
  23. ; Answer No, then find the Coordinates > Ascension button settings and adjust if needed.
  24. ; 6. Now click Alt+F4 to manually restart the ascend function.
  25. ; Before hitting Yes to continue, verify that your junk pile is ok to salvage.
  26. ; 7. If the script managed to salvage and ascend successfully, then everything is now operational.
  27. ;
  28. ; Options you might want to change:
  29. ; * speedRunTime - depending on the end zone lvl you aim at, adjust as needed
  30. ; * activateSkillsAtStart - if you do longer runs (>35 minutes), you might benefit from the energize + dark ritual dps bonus
  31. ; * autoAscend - for those over night farm sessions
  32. ;
  33. ; If you can speed run to 1700 or above (in less than 30 minutes) and have a hybrid build (with Bhaal, Frag,
  34. ; Jugg and co.), you might want to try the Deep run option. It is designed to start off where a speed run
  35. ; finish and will only lvl up the same ranger till the end. Just set the deepRunTime duration and hit Ctrl+F2.
  36. ;
  37. ; Note that you must reload the script with Alt+F5 (and Alt+F6 if you run in a browser) for any change to take effect.
  38. ;
  39. ; At any given time, you can pause the script with the Pause button, or abort a run with Alt+Pause.
  40.  
  41. ; -----------------------------------------------------------------------------------------
  42.  
  43. #Persistent
  44. #NoEnv
  45. #InstallKeybdHook
  46. Thread, interrupt, 0
  47.  
  48. winName=Clicker Heroes
  49.  
  50. global ProgressBar, ProgressBarTime ; progress bar controls
  51.  
  52. exitThread = 0
  53. exitDRThread = 0
  54.  
  55. SetTitleMatchMode, 3 ; Steam (3) or browser (regex) version?
  56.  
  57. ; If browser, you need to verify (or adjust) this top margin setting:
  58. browserTopMargin = 230 ; Chrome (222), Firefox (230), IE (198)
  59.  
  60. ; Start the script, then:
  61. ; Alt+Middle Mouse Button the top edge of the CH area (below the logo) to get the coordinate.
  62. ; When done, reload the script with Alt+F5 and calculate browser offsets with Alt+F6.
  63.  
  64. ; Note that Chrome steals focus, so I would recommend using Firefox.
  65.  
  66. ; All the script coordinates are based on these four dimensions. DO NOT CHANGE!
  67. chWidth = 1136
  68. chHeight = 640
  69. chLeftMargin = 8
  70. chTopMargin = 30
  71.  
  72. ; These will be calculated by the script
  73. leftMarginOffset = 0
  74. topMarginOffset = 0
  75.  
  76. ; -----------------------------------------------------------------------------------------
  77. ; -- Configuration
  78. ; -----------------------------------------------------------------------------------------
  79.  
  80. ; In Clicker Heroes, turn off the "Show relic found popups" option.
  81.  
  82. ; This is the base setting for how fast or slow the script will run.
  83. ; 200 is a safe setting. Anything lower than 150 is on your own risk!
  84. zzz = 200 ; sleep delay (in ms) after a click
  85.  
  86. lvlUpDelay = 5 ; time (in seconds) between lvl up clicks
  87. barUpdateDelay = 30
  88.  
  89. ; -- Speed run ----------------------------------------------------------------------------
  90.  
  91. ; http://s3-us-west-2.amazonaws.com/clickerheroes/ancientssoul.html
  92.  
  93. speedRunTime = 30 ; minutes
  94. irisLevel = 140 ; try to keep your Iris within 1000 levels of your optimal zone lvl
  95.  
  96. ; 1:dread knight, 2:atlas, 3:terra, 4:phthalo, 5:banana, 6:lilin, 7:cadmia, 8:alabaster, 9:astraea
  97. gildedRanger = 2 ; your main guilded ranger. Tip: Keep 1 gild on the hero starting the run.
  98.  
  99. ; Adjust this setting so the script reach and can level your gilded ranger to >150 instantly.
  100. thresholdFactor = 1 ; 0, 1 or 2
  101.  
  102. activateSkillsAtStart = 0
  103.  
  104. ; Added flag for v0.19.
  105. autoAscend = 0 ; Warning! Set to 1 will both salvage relics and ascend without any user intervention!
  106.  
  107. ; -- Deep run -----------------------------------------------------------------------------
  108.  
  109. deepRunTime = 30 ; minutes
  110. coolDownTime = 15 ; assuming Vaagur lvl 15
  111. clickableDelay = 30 ; hunt for a clickable every 30s (set to 0 to stop hunting)
  112.  
  113. ; If you want a stable run, I strongly recommend using an external auto-clicker.
  114. cpsTarget = 25 ; monster clicks per second (0 for external)
  115.  
  116. ; -- Coordinates --------------------------------------------------------------------------
  117.  
  118. ; Use Windows Spy (for Steam version) or click Alt+MiddleMouseButton to tune the below (relative) coordinates.
  119.  
  120. ; Top LVL UP button when scrolled to the bottom
  121. xLvl = 100
  122. yLvl = 285
  123. oLvl = 107 ; offset to next button
  124.  
  125. ; Approximate Iris lvl thresholds that affect the scroll bar:
  126. ; 260 (Atlas), 510 (Terra), 760 (Phthalo), 1010 (Banana), 1260 (Lilin)
  127.  
  128. ; initRun function settings
  129. initDownClicks := [7,8,7,8,7,4] ; # of clicks down needed to get next 4 heroes in view (after an ascension + clickable)
  130.  
  131. ; This y coordinate is supposed to keep itself inside the top lvl up button when scrolling down according to the above "clicking pattern".
  132. ; Trial run with Alt+F2. Tip: If things move to fast, temporarily increase the zzz parameter to slow down the script.
  133. yLvlInit = 240
  134.  
  135. ; After an ascend plus (non-idle) clickable, who's at the bottom? Suggested settings:
  136. ; Lilin [6,6,6,6,6,3], 285
  137. ; Banana [6,7,6,7,6,3], 240
  138. ; Phthalo [6,7,7,6,7,3], 273
  139. ; Terra [7,7,7,7,7,3], 240
  140. ; Atlas [7,7,7,8,7,3], 273
  141. ; Dread Knight [7,8,7,8,7,4], 257
  142.  
  143. ; Ascension button settings
  144. ascDownClicks = 25 ; # of down clicks needed to get the button as centered as possible (after a full speed run)
  145. xAsc = 310
  146. yAsc = 468
  147.  
  148. buttonSize = 34
  149.  
  150. ; Ascend Yes button
  151. xYes = 500
  152. yYes = 445
  153.  
  154. xCombatTab = 50
  155. yCombatTab = 130
  156.  
  157. xRelicTab = 380
  158. yRelicTab = 130
  159.  
  160. xSalvageJunk = 280
  161. ySalvageJunk = 470
  162.  
  163. xDestroyYes = 500
  164. yDestroyYes = 430
  165.  
  166. ; Scrollbar
  167. xScroll = 555
  168. yUp = 220
  169. yDown = 650
  170. top2BottomClicks = 50
  171.  
  172. ; Buy Available Upgrades button
  173. xBuy = 300
  174. yBuy = 580
  175.  
  176. xHero = 474
  177. yHero = 229
  178.  
  179. xMonster = 860
  180. yMonster = 420
  181.  
  182. ; No smart image recognition, so we click'em all!
  183. get_clickable()
  184. {
  185. global
  186. ; Break idle on purpose to get the same amount of gold every run
  187. clickPos(xMonster, yMonster)
  188. clickPos(xMonster, yMonster)
  189. sleep 1000
  190. clickPos(524, 487)
  191. clickPos(747, 431)
  192. clickPos(755, 480)
  193. clickPos(760, 380)
  194. clickPos(873, 512)
  195. clickPos(1005, 453)
  196. clickPos(1053, 443)
  197. }
  198.  
  199. ; -----------------------------------------------------------------------------------------
  200. ; -- Hotkeys (+=Shift, !=Alt, ^=Ctrl)
  201. ; -----------------------------------------------------------------------------------------
  202.  
  203. ; Quick initial tests:
  204. ; Shift+F1 should scroll down to the bottom and lvl up the top hero
  205. ; Shift+F2 should lvl up the wandering fisherman
  206. ; Shift+F3 should switch to the relics tab and then back
  207.  
  208. +F1::
  209. scrollToBottom()
  210. clickPos(xLvl, yLvl)
  211. return
  212.  
  213. +F2::
  214. scrollToTop()
  215. scrollDown(initDownClicks[1])
  216. clickPos(xLvl, yLvl)
  217. return
  218.  
  219. +F3::
  220. switchToRelicTab()
  221. switchToCombatTab()
  222. return
  223.  
  224. ; Show the cursor position with Alt+Middle Mouse Button
  225. !mbutton::
  226. mousegetpos, xpos, ypos
  227. msgbox,% "Cursor position: x" xpos-leftMarginOffset " y" ypos-topMarginOffset
  228. return
  229.  
  230. ; Reload script with Alt+F5
  231. !F5::
  232. showSplash("Reloading...", 2, 0)
  233. Reload
  234. return
  235.  
  236. ; Calculate browser offsets compared to the Steam client with Alt+F6
  237. !F6::
  238. winName=Lvl.*Clicker Heroes.*
  239.  
  240. IfWinExist, % winName
  241. {
  242. showSplash("Calculating browser offsets...")
  243.  
  244. WinActivate
  245. WinGetPos, x, y, winWidth, winHeight
  246.  
  247. leftMargin := (winWidth - chWidth) // 2
  248. leftMarginOffset := leftMargin - chLeftMargin
  249. topMarginOffset := browserTopMargin - chTopMargin
  250. } else {
  251. showSplash("Clicker Heroes started?")
  252. }
  253. return
  254.  
  255. ; Pause/Unpause script
  256. Pause::Pause
  257. return
  258.  
  259. ; Abort speed/deep runs and auto ascensions with Alt+Pause
  260. !Pause::
  261. showSplash("Aborting...", 2, 0)
  262. exitThread = 1
  263. exitDRThread = 1
  264. return
  265.  
  266. ; Alt+F1 to F4 are here to test the individual parts of the full speed run loop
  267.  
  268. !F1::
  269. get_clickable()
  270. sleep 8000
  271. toggleMode()
  272. return
  273.  
  274. !F2::
  275. initRun()
  276. return
  277.  
  278. !F3::
  279. speedRun()
  280. return
  281.  
  282. !F4::
  283. ascend(autoAscend)
  284. return
  285.  
  286. ; Speed run loop.
  287. ; Use to farm Hero Souls
  288. ^F1::
  289. keywait, ctrl
  290. showSplash("Starting speed runs...", 2, 0)
  291. loop
  292. {
  293. get_clickable()
  294. sleep 8000 ; wait 8s to pick up all coins
  295. toggleMode() ; toggle to progression mode
  296. initRun()
  297. if (activateSkillsAtStart) {
  298. activateSkills()
  299. activateEdrSkills()
  300. }
  301. speedRun()
  302. ascend(autoAscend)
  303. }
  304. return
  305.  
  306. ; Deep run.
  307. ; Use (after a speed run) to get a few new gilds every now and then
  308. ^F2::
  309. exitDRThread = 0
  310. monsterClicks = 0
  311. drDuration := deepRunTime * 60
  312. cds := coolDownTime * 60
  313.  
  314. showSplash("Starting deep run...", 2, 0)
  315. startProgress("Deep Run Progress", 0, drDuration // barUpdateDelay)
  316.  
  317. drStartTime := A_TickCount
  318.  
  319. fastMode()
  320.  
  321. setTimer, endDeepRun, % -drDuration * 1000 ; run only once
  322. if (cpsTarget > 0) {
  323. setTimer, slayMonsters, % 1000 / cpsTarget
  324. }
  325.  
  326. toggle = true
  327.  
  328. while(!exitDRThread)
  329. {
  330. if (mod(A_Index, cds) = 0) {
  331. if (toggle) {
  332. activateSkills()
  333. activateEdrSkills()
  334. } else {
  335. activateErSkills()
  336. activateSkills()
  337. }
  338. toggle := !toggle
  339. }
  340. if (mod(A_Index, lvlUpDelay) = 0) {
  341. ctrlClick(xLvl, yLvl + oLvl, 1, 0)
  342. }
  343. if (mod(A_Index, clickableDelay) = 0) {
  344. get_clickable()
  345. }
  346. updateProgress(A_Index // barUpdateDelay, drDuration - A_Index)
  347. sleep 1000
  348. }
  349.  
  350. setTimer, slayMonsters, off
  351.  
  352. clicksPerSecond := round(monsterClicks / secondsSince(drStartTime), 2)
  353.  
  354. stopProgress()
  355. showSplash("Deep run ended (" . clicksPerSecond . " cps)")
  356. return
  357.  
  358. ; -----------------------------------------------------------------------------------------
  359. ; -- Functions
  360. ; -----------------------------------------------------------------------------------------
  361.  
  362. ; Level up and upgrade all heroes
  363.  
  364. initRun() {
  365. global
  366.  
  367. switchToCombatTab()
  368.  
  369. clickPos(xHero, yHero) ; prevent initial upgrade ctrlClick fails
  370.  
  371. upgrade(initDownClicks[1],2,,2) ; cid --> brittany
  372. upgrade(initDownClicks[2]) ; fisherman --> leon
  373. upgrade(initDownClicks[3]) ; seer --> mercedes
  374. upgrade(initDownClicks[4],,,,2) ; bobby --> king
  375. upgrade(initDownClicks[5],2,,,2) ; ice --> amenhotep
  376. upgrade(initDownClicks[6],,,2) ; beastlord --> shinatobe
  377. upgrade(0,,,,,1) ; grant & frostleaf
  378.  
  379. buyAvailableUpgrades()
  380. }
  381.  
  382. upgrade(times, cc1:=1, cc2:=1, cc3:=1, cc4:=1, skip:=0) {
  383. global
  384.  
  385. if (!skip) {
  386. ctrlClick(xLvl, yLvlInit, cc1)
  387. ctrlClick(xLvl, yLvlInit + oLvl, cc2)
  388. }
  389. ctrlClick(xLvl, yLvlInit + oLvl*2, cc3)
  390. ctrlClick(xLvl, yLvlInit + oLvl*3, cc4)
  391.  
  392. scrollDown(times)
  393. }
  394.  
  395. ; All heroes/rangers are expected to "insta-kill" everything at max speed (i.e. around
  396. ; 7 minutes per 250 levels). Only the last 2-3 minutes should slow down slightly.
  397. speedRun() {
  398. global
  399.  
  400. local stint := 0
  401. local stints := 2
  402. local tMax := 7 * 60
  403. local lMax := 250
  404. local lvlThreshold := 35 * thresholdFactor
  405. local zoneLvl := gildedRanger * lMax + lvlThreshold ; approx zone lvl where we can buy our gilded ranger @ lvl 150
  406. local lvls := zoneLvl - irisLevel ; lvl's to get there
  407. local midStintTime := 0
  408.  
  409. if (lvls > lMax) ; add a mid stint if needed
  410. {
  411. midStintTime := tMax
  412. lvls -= lMax
  413. stints += 1
  414. }
  415. local firstStintTime := ceil(lvls * tMax / lMax)
  416. local srDuration := speedRunTime * 60
  417. local totalClickDelay := (srDuration // lvlUpDelay) * zzz // 1000
  418. local lastStintTime := srDuration - firstStintTime - midStintTime - totalClickDelay
  419.  
  420. showSplash("Starting speed run...", 2, 0)
  421.  
  422. switchToCombatTab()
  423.  
  424. if (irisLevel < lMax + lvlThreshold) ; Iris high enough to start with a ranger?
  425. {
  426. scrollDown(initDownClicks[1])
  427. lvlUp(firstStintTime, 0, 3, ++stint, stints) ; nope, let's bridge with Samurai
  428. scrollToBottom()
  429. } else {
  430. scrollToBottom()
  431. lvlUp(firstStintTime, 1, 1, ++stint, stints)
  432. scrollWayDown(2)
  433. }
  434. if (midStintTime) {
  435. lvlUp(midStintTime, 1, 2, ++stint, stints)
  436. scrollWayDown(2)
  437. }
  438. lvlUp(lastStintTime, 1, 2, ++stint, stints)
  439.  
  440. showSplash("Speed run completed.")
  441. }
  442.  
  443. lvlUp(seconds, buyUpgrades, button, stint, stints) {
  444. global
  445. exitThread = 0
  446. local y := yLvl + oLvl * (button - 1)
  447. local title := "Speed Run - Leveling Hero " . stint . "/" . stints
  448.  
  449. if (buyUpgrades) {
  450. ctrlClick(xLvl, y)
  451. buyAvailableUpgrades()
  452. }
  453. maxClick(xLvl, y)
  454.  
  455. startProgress(title, 0, seconds // barUpdateDelay)
  456. loop % seconds
  457. {
  458. if (mod(A_Index, lvlUpDelay) = 0) {
  459. ctrlClick(xLvl, y)
  460. }
  461. updateProgress(A_Index // barUpdateDelay, seconds - A_Index)
  462. if (exitThread) {
  463. stopProgress()
  464. showSplash("Speed run aborted!")
  465. exit
  466. }
  467. sleep 1000
  468. }
  469. stopProgress()
  470. }
  471.  
  472. ascend(autoYes:=0) {
  473. global
  474. exitThread = 0
  475. local y = yAsc - 3 * buttonSize
  476.  
  477. if (autoYes) {
  478. showSplash("10 seconds till ASCENSION! (Abort with Alt+Pause)", 10, 2)
  479. if (exitThread) {
  480. showSplash("Ascension aborted!")
  481. exit
  482. }
  483. } else {
  484. playWarningSound()
  485. msgbox, 4,,Salvage Junk Pile & Ascend?
  486. ifmsgbox no
  487. exit
  488. }
  489.  
  490. salvageJunkPile() ; must salvage junk relics before ascending
  491.  
  492. switchToCombatTab()
  493.  
  494. scrollDown(ascDownClicks)
  495. sleep % zzz * 2
  496.  
  497. ; Scrolling is not an exact science, hence we click above, center and below
  498. loop 9
  499. {
  500. clickPos(xAsc, y)
  501. y := y + buttonSize
  502. }
  503. sleep % zzz * 4
  504. clickPos(xYes, yYes)
  505. sleep % zzz * 2
  506. }
  507.  
  508. salvageJunkPile() {
  509. global
  510.  
  511. switchToRelicTab()
  512. clickPos(xSalvageJunk, ySalvageJunk)
  513. sleep % zzz * 4
  514. clickPos(xDestroyYes, yDestroyYes)
  515. sleep % zzz * 2
  516. }
  517.  
  518. switchToRelicTab() {
  519. global
  520. clickPos(xRelicTab, yRelicTab)
  521. sleep % zzz * 2
  522. }
  523.  
  524. switchToCombatTab() {
  525. global
  526. clickPos(xCombatTab, yCombatTab)
  527. sleep % zzz * 4
  528. }
  529.  
  530. buyAvailableUpgrades() {
  531. global
  532. scrollToBottom()
  533. clickPos(xBuy, yBuy)
  534. sleep % zzz * 3
  535. }
  536.  
  537. scrollUp(clickCount:=1) {
  538. global
  539. fastMode()
  540. clickPos(xScroll, yUp, clickCount)
  541. slowMode()
  542. sleep % zzz * 2
  543. }
  544.  
  545. scrollDown(clickCount:=1) {
  546. global
  547. fastMode()
  548. clickPos(xScroll, yDown, clickCount)
  549. slowMode()
  550. sleep % zzz * 2
  551. }
  552.  
  553. ; Scroll down fix when at bottom and scroll bar don't update correctly
  554. scrollWayDown(clickCount:=1) {
  555. scrollUp()
  556. scrollDown(clickCount + 1)
  557. }
  558.  
  559. scrollToTop() {
  560. global
  561. scrollUp(top2BottomClicks)
  562. sleep % 1000 - zzz
  563. }
  564.  
  565. scrollToBottom() {
  566. global
  567. scrollDown(top2BottomClicks)
  568. sleep % 1000 - zzz
  569. }
  570.  
  571. maxClick(xCoord, yCoord) {
  572. global
  573. ControlSend,, {shift down}{q down}, % winName
  574. clickPos(xCoord, yCoord, clickCount)
  575. ControlSend,, {q up}{shift up}, % winName
  576. sleep % zzz
  577. }
  578.  
  579. ctrlClick(xCoord, yCoord, clickCount:=1, sleepSome:=1) {
  580. global
  581. ControlSend,, {ctrl down}, % winName
  582. clickPos(xCoord, yCoord, clickCount)
  583. ControlSend,, {ctrl up}, % winName
  584. if (sleepSome) {
  585. sleep % zzz
  586. }
  587. }
  588.  
  589. clickPos(xCoord, yCoord, clickCount:=1) {
  590. global
  591. ControlClick,% "x" xCoord+leftMarginOffset " y" yCoord+topMarginOffset,% winName,,,% clickCount,Pos
  592. }
  593.  
  594. ; Toggle between farm and progression modes
  595. toggleMode() {
  596. global
  597. ControlSend,, {a down}{a up}, % winName
  598. }
  599.  
  600. activateSkills() {
  601. global
  602. ControlSend,, {1 down}{1 up}, % winName ; clickstorm
  603. ControlSend,, {2 down}{2 up}, % winName ; powersurge
  604. ControlSend,, {3 down}{3 up}, % winName ; lucky strikes
  605. ControlSend,, {4 down}{4 up}, % winName ; metal detector
  606. ControlSend,, {5 down}{5 up}, % winName ; golden clicks
  607. ControlSend,, {7 down}{7 up}, % winName ; super clicks
  608. }
  609.  
  610. activateEdrSkills() {
  611. global
  612. ControlSend,, {8 down}{8 up}, % winName ; energize
  613. ControlSend,, {6 down}{6 up}, % winName ; dark ritual
  614. ControlSend,, {9 down}{9 up}, % winName ; reload
  615. }
  616.  
  617. activateErSkills() {
  618. global
  619. ControlSend,, {8 down}{8 up}, % winName ; energize
  620. ControlSend,, {9 down}{9 up}, % winName ; reload
  621. }
  622.  
  623. playWarningSound() {
  624. SoundPlay, %A_WinDir%\Media\tada.wav
  625. }
  626.  
  627. showSplash(text, seconds:=5, sound:=1) {
  628. splashtexton,200,40,Auto-clicker,%text%
  629. if (sound = 1) {
  630. SoundPlay, %A_WinDir%\Media\Windows User Account Control.wav
  631. } else if (sound = 2) {
  632. playWarningSound()
  633. }
  634. sleep % seconds * 1000
  635. splashtextoff
  636. }
  637.  
  638. startProgress(title, min:=0, max:=100) {
  639. gui, new
  640. gui, margin, 0, 0
  641. gui, font, s18
  642. gui, add, progress,% "w300 h28 range" min "-" max " -smooth vProgressBar"
  643. gui, add, text, w92 vProgressBarTime x+2
  644. gui, show, x20 y20,% title
  645. }
  646.  
  647. updateProgress(position, remainingTime) {
  648. guicontrol,, ProgressBar,% position
  649. guicontrol,, ProgressBarTime,% formatSeconds(remainingTime)
  650. }
  651.  
  652. stopProgress() {
  653. gui, destroy
  654. }
  655.  
  656. formatSeconds(s) {
  657. time = 19990101 ; *Midnight* of an arbitrary date.
  658. time += %s%, seconds
  659. FormatTime, timeStr, %time%, HH:mm:ss
  660. return timeStr
  661. }
  662.  
  663. secondsSince(startTime) {
  664. return (A_TickCount - startTime) // 1000
  665. }
  666.  
  667. fastMode() {
  668. SetControlDelay, -1
  669. }
  670.  
  671. slowMode() {
  672. SetControlDelay, 20
  673. }
  674.  
  675. ; -----------------------------------------------------------------------------------------
  676. ; -- Subroutines
  677. ; -----------------------------------------------------------------------------------------
  678.  
  679. endDeepRun:
  680. exitDRThread = 1
  681. return
  682.  
  683. slayMonsters:
  684. clickPos(xMonster, yMonster)
  685. monsterClicks++
  686. return
Advertisement
Add Comment
Please, Sign In to add comment