From 495b70d7ab7fad7eb72b051f4fa6ac4fce23b7bf Mon Sep 17 00:00:00 2001 From: swiftb Date: Sat, 19 Dec 2015 14:56:59 +0100 Subject: [PATCH 1/7] Scroll further down after the first Speed run stint --- ch_sw1ft_bot.ahk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index 3ae8513..e0b8e3a 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -846,7 +846,7 @@ speedRun() { toggleMode(!useMidasStart) ; toggle to progression mode if (firstStintTime > 0) { lvlUp(firstStintTime, 1, firstStintButton, ++stint, stints) - scrollWayDown(3) + scrollWayDown(5) } lvlUp(lastStintTime, 1, lastStintButton, ++stint, stints) @@ -1406,4 +1406,4 @@ return comboTimer: activateSkills(deepRunCombo[comboIndex]) comboIndex := comboIndex < deepRunCombo.MaxIndex() ? comboIndex+1 : 2 -return \ No newline at end of file +return From db51cce52cd10a767b9c2335f24f95ceb4cfda89 Mon Sep 17 00:00:00 2001 From: swiftb Date: Fri, 1 Jan 2016 23:54:51 +0100 Subject: [PATCH 2/7] If gilded, don't try to get buffs for Max or Gog --- ch_sw1ft_bot.ahk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index 3ae8513..85f0eed 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -613,8 +613,8 @@ visionRun() { local isInitiated := false local isClickerRunning := false local hasActivatedSkills := false - local hasBomberBuff := false - local hasGogBuff := false + local hasBomberBuff := gildedRanger = 12 ? true : false + local hasGogBuff := gildedRanger = 13 ? true : false local xClose := 0, yClose := 0 local xBtn := 0, yBtn := 0, isNew := 0 From 1b8eb1452d1b84864db9c704fceb68553c8742db Mon Sep 17 00:00:00 2001 From: swiftb Date: Thu, 21 Jan 2016 01:57:14 +0100 Subject: [PATCH 3/7] Added logging and a Vision Run early game option --- README.md | 80 ++- ch_bot_lib.ahk | 104 ++- ch_sw1ft_bot.ahk | 704 +++++++++++++++----- common_setups.md | 111 +-- images/clickable.png | Bin 132 -> 142 bytes images/dk_g.png | Bin 0 -> 696 bytes images/frigid_enchant.png | Bin 205 -> 0 bytes images/lucky_strikes.png | Bin 0 -> 387 bytes images/max_lvl.png | Bin 0 -> 417 bytes images/skill_bar.png | Bin 189 -> 148 bytes logs/.gitignore | 1 + monster_clicker.ahk | 13 +- system/ch_bot_default_settings.ahk | 80 ++- system/ch_bot_lib_default_settings.ahk | 8 + system/monster_clicker_default_settings.ahk | 1 - 15 files changed, 797 insertions(+), 305 deletions(-) create mode 100644 images/dk_g.png delete mode 100644 images/frigid_enchant.png create mode 100644 images/lucky_strikes.png create mode 100644 images/max_lvl.png create mode 100644 logs/.gitignore diff --git a/README.md b/README.md index 48c7585..fb42717 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Clicker Heroes Sw1ft Bot -A mid/late game bot for [Clicker Heroes][Reddit]. +A game bot for [Clicker Heroes][Reddit]. ## Overview @@ -25,6 +25,7 @@ A mid/late game bot for [Clicker Heroes][Reddit]. * Built in re-gilder between rangers * Option to auto-save before ascending * Monitored _click safety zones_ preventing bot misclicks +* Logging to file ### Features without image search @@ -38,7 +39,7 @@ A mid/late game bot for [Clicker Heroes][Reddit]. - Intended as a continuation of a speed run - Utilizes the external _monster clicker_ -Limitations: +**Limitations:** * Without the support from visual cues, it is critically important that the [recommended game state](#minimum-recommended-game-state) is adhered to. @@ -51,21 +52,22 @@ Limitations: - Picks up *clickables* without breaking idle - Does a Midas start if no clickable - Can automatically resume + - Can be set to run in early game mode * Enhanced Midas starts * Can auto-level Solomon * Hotkeys for raiding -Limitations: +**Limitations:** * Only supported in the browser client (in low quality) * Window must be visible in the foreground ### Minimum recommended game state -To operate as intended, the (background) Speed run needs a certain minimum game state: +**To operate as intended, the (background) Speed run needs a certain minimum game state:** * Atlas or higher ranger gilded - - Any transitional hero/ranger used by the script must also be gilded + - Any transitional hero used by the script must also be gilded * _Optimal zone_ > 1000 * Iris > 145 (and within 1001 levels of the _optimal zone_) * Siyalatas > 200 @@ -73,12 +75,17 @@ To operate as intended, the (background) Speed run needs a certain minimum game These recommendations should give you enough gold after ascending with a *[clickable][Clickables]*, to instantly unlock, level and buy all upgrades for every hero down to and including Frostleaf. -Recommended minimum for the (foreground) Vision run: +**_Minimum Iris lvl formula_:** `x * 250 + 29`, where `x = 1` for Terra (279), `x = 2` for Phthalo (529) and so on. This allows you to use a transitional hero 3 steps above you main gilded ranger. E.g. with Lilin gilded and an Iris above `4 * 250 + 29 = 1029`, you can use Terra as your transitional hero (having 1 gild). + +**Recommended minimum for the (foreground) Vision run:** * Samurai gilded - If the gilded hero is not visible after a clickable or Midas start, a transitional hero must be gilded -Midas start requirements: +* [Early Game Mode] World Ascensions > 2 + - Need the Progression Mode option and the Buy Available Upgrades button + +**Midas start requirements:** * A maxed Khrysos * Iris equal or higher than the _zone 2_ setting @@ -101,7 +108,7 @@ Unless they already exist, three user settings files will be created as copies o `ch_bot_lib_settings.ahk`, `ch_bot_settings.ahk` and `monster_clicker_settings.ahk`. -Note: If your Windows account don't have administrator rights, you might have to start the script by right-clicking it and select **Run as Administrator**. +**Note:** If your Windows account don't have administrator rights, you might have to start the script by right-clicking it and select **Run as Administrator**. ## Configuration @@ -121,8 +128,8 @@ These only need to be changed if you run the browser client. | Variable | Explanation | | -------- | ----------- | -`SetTitleMatchMode` | **`3`** for Steam or **`regex`** for browser version (1) -`browser` | Browser name (e.g. Opera) +`SetTitleMatchMode` | **3** for Steam or **regex** for browser version (1) +`browser` | Browser name (e.g. Opera) `browserTopMargin` | Browser top margin (2) (1) Browser recommendation: Run Clicker Heroes in Opera, then use Chrome or some other browser for your normal surfing activities. @@ -130,7 +137,17 @@ These only need to be changed if you run the browser client. (2) Make sure the Clicker Heroes window have focus, then click Ctrl+Middle Mouse Button dead center in the ancient tab eye like this: ![](images/ancient_eye_click.png?raw=true). Update the top margin and reload the script with Alt+F5, then position your mouse cursor at the top left corner (of the CH area) and click Alt+Middle Mouse Button. If the setting is correct, it should look like this: ![](images/top_corner_alt_mmb.png?raw=true) -Known issues: +### Optional lib settings + +| Variable | Explanation | +| -------- | ----------- | +`fullScreenOption` | [**true**/**false**] Steam borderless fullscreen +`showSeverityLevel` | **0**:OFF, **1**:WARN, **2**:USER, **3**:INFO, **4**:DEBUG +`logSeverityLevel` | **0**:OFF, **1**:WARN, **2**:USER, **3**:INFO, **4**:DEBUG + +Setting a level to X, will show or log all messages from that level and below. E.g. setting `showSeverityLevel` to **1** and `logSeverityLevel` to **4**, will only show warning messages as splash texts, but will log everything to file. + +**Known issues:** * If active, the power savings setting turning of your monitor(s) can cause issues with AHK's image recognition. When last tested, only Firefox continued to run without any issues. * The script can't handle any extra _stuff_ on the left side, e.g. a bookmark list. @@ -142,38 +159,38 @@ Known issues: | Variable | Explanation | | -------- | ----------- | `irisLevel` | Set to your Iris level in game +`gildedRanger` | The number of your main gilded ranger (3) + +(3) **1**:Dread Knight, **2**:Atlas, **3**:Terra, **4**:Phthalo, **5**:Banana, **6**:Lilin, **7**:Cadmia, **8**:Alabaster, **9**:Astraea, **10**:Chiron, **11**:Moloch, **12**:Bomber Max, **13**:Gog, **14**:Wepwawet #### Mandatory Speed run settings | Variable | Explanation | | -------- | ----------- | -`speedRunTime` | The duration of the speed run (3) -`gildedRanger` | The number of your gilded ranger (4) +`speedRunTime` | The duration of the speed run (4) -(3) Set according to the [Ancients Optimizer][] (open with Ctrl+F5). +(4) Set according to the [Ancients Optimizer][] (open with Ctrl+F5). -(4) **1**:Dread Knight, **2**:Atlas, **3**:Terra, **4**:Phthalo, **5**:Banana, **6**:Lilin, **7**:Cadmia, **8**:Alabaster, **9**:Astraea, **10**:Chiron, **11**:Moloch, **12**:Bomber Max, **13**:Gog, **14**:Wepwawet +**Important!** Use the Siyalatas [regilding chart][] to make sure you are gilded correctly. Any transitional hero used by the bot must also be gilded. -**Important!** Use the Siyalatas [regilding chart][] to make sure you are gilded correctly. Any transitional hero/ranger used by the bot must also be gilded. - -#### Mandatory Deep run settings +#### Mandatory Vision run settings | Variable | Explanation | | -------- | ----------- | -`deedRunTime` | The duration of the deep run -`deepRunClicks` | [`true`/`false`] Actively click? +`useImageSearch` | Set to **true** +`endLvlIdle` | Idle end level +`endLvlActive` | Active end level -Note: With `deepRunClicks` set to true, the separate _monster clicker_ script will be automatically started and controlled by the main bot script. +Set `endLvlActive` to zero for idle, `endLvlIdle` to zero for active and `endLvlActive` higher than `endLvlIdle` for hybrid. -#### Mandatory Vision run settings +#### Mandatory Deep run settings | Variable | Explanation | | -------- | ----------- | -`useImageSearch` | Set to `true` -`endLvlIdle` | Idle end level -`endLvlActive` | Active end level +`deedRunTime` | The duration of the deep run +`deepRunClicks` | [**true**/**false**] Actively click? -Set `endLvlActive` to zero for idle, `endLvlIdle` to zero for active and `endLvlActive` higher than `endLvlIdle` for hybrid. +**Note:** With `deepRunClicks` set to true, the separate _monster clicker_ script will be automatically started and controlled by the main bot script. ### Optional bot settings @@ -197,9 +214,9 @@ The Vision run is usually not that picky about game state, just try start it wit | State | Error | Solution | | ----- | ----- | -------- | -3 | No Clicker Heroes window found | Open the client --2 | No vision | Set `useImageSearch` to `true` +-2 | No vision | Set `useImageSearch` to **true** -1 | Vision, but not in browser | Use the browser client - 0 | Vision, but not finding anything | Use standard (100%) Windows sizes + 0 | Vision, but not finding anything | Use standard (100%, 96 DPI) Windows sizes ## Main Hotkeys @@ -215,7 +232,7 @@ The Vision run is usually not that picky about game state, just try start it wit Shift+Ctrl+F5 | Schedule a script reload after finishing the current run, then restart it Alt+F6 | Re-initialize coordinates (needed after moving or re-sizing the client window) -(5) Requires `useImageSearch` set to `true`. +(5) Requires `useImageSearch` set to **true**. #### Supplementary Hotkeys @@ -234,12 +251,9 @@ These hotkeys can be executed while a speed, deep or vision run is active. Win+F7 | One paid raid (5) Win+F8 | `raidAttempts` paid raids (5) Shift+Ctrl+F1 | Toggle the `autoAscend` flag -Shift+Ctrl+F2 | Toggle the `screenShotRelics` flag Shift+Ctrl+F6 | Toggle the `playNotificationSounds` flag Shift+Ctrl+F7 | Toggle the `playWarningSounds` flag -Shift+Ctrl+F8 | Toggle the `showSplashTexts` flag Shift+Ctrl+F11 | Toggle the `saveBeforeAscending` flag -Shift+Ctrl+F12 | Toggle the `debug` flag (6) Will pause the monster clicker if running. @@ -265,7 +279,7 @@ Check the [FAQ](FAQ.md) or visit the original script [home][] on Reddit. [Steam]: http://store.steampowered.com/app/363970/ [Web]: https://www.clickerheroes.com/ [AutoHotkey]: http://ahkscript.org/ -[Rules of Thumb]: http://redd.it/339m3j +[Rules of Thumb]: https://redd.it/3y57jd [Ancients Calculator]: http://hsoptimizer.github.io/ancient/ [Ancients Optimizer]: http://philni.neocities.org/ancientssoul.html [regilding chart]: https://redd.it/3frj62 diff --git a/ch_bot_lib.ahk b/ch_bot_lib.ahk index 05e4396..a9902f3 100644 --- a/ch_bot_lib.ahk +++ b/ch_bot_lib.ahk @@ -5,7 +5,7 @@ CoordMode, Pixel, Screen -libVersion=1.4 +libVersion=1.5 winName := "Clicker Heroes" @@ -46,7 +46,7 @@ barUpdateDelay := 30 ; time (in seconds) between progress bar updates coinPickUpDelay := 5 ; time (in seconds) needed to pick up all coins from a clickable nextHeroDelay := 5 ; extra gold farm delay (in seconds) between heroes -scrollDelay := 275 ; base delay (in ms) +scrollDelay := 300 ; base delay (in ms) scrollClickDelay := 20 ; delay per click (in ms) dialogBoxClass := "#32770" @@ -57,6 +57,8 @@ dimmedYellowColor := 0x7E6500 goldColor := 0xFFB423 brightGoldColor := 0xFFD911 +severityLevels := {"OFF":0, "WARN":1, "USER":2, "INFO":3, "DEBUG":4} + ; -- Images ------------------------------------------------------------------------------- ; Combat zone offsets @@ -76,23 +78,25 @@ imgClickable := {file:"clickable.png", topOffset:CZTO, leftOffset:CZLO, bottomOf imgSkillBar := {file:"skill_bar.png", topOffset:0, leftOffset:575, bottomOffset:0, rightOffset:-496} imgSkillLocked := {file:"skill_locked.png", topOffset:0, leftOffset:575, bottomOffset:0, rightOffset:-496} +imgLuckyStrikes := {file:"lucky_strikes.png", topOffset:0, leftOffset:575, bottomOffset:0, rightOffset:-496} imgCombat := {file:"combat.png", topOffset:0, leftOffset:0, bottomOffset:CZBO, rightOffset:CZRO} imgHire := {file:"hire.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgCoin := {file:"coin.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} +imgMaxLvl := {file:"max_lvl.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgDimmedSkill := {file:"skill_dimmed.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgSkill := {file:"skill.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgClickstorm := {file:"clickstorm.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgMetalDetector := {file:"metal_detector.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgGoldenClicks := {file:"golden_clicks.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} -imgFrigidEnchant := {file:"frigid_enchant.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgCid := {file:"cid.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgMercedes := {file:"mercedes.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgReferi := {file:"referi.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgDK := {file:"dk.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} +imgDKG := {file:"dk_g.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgMax := {file:"max.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgGog := {file:"gog.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} imgSolomon := {file:"solomon.png", topOffset:CZTO, leftOffset:0, bottomOffset:0, rightOffset:CZRO} @@ -118,6 +122,10 @@ oLvl := 107 ; offset to next button buttonSize := 34 +; Progression/Farm Mode +xMode := 1121 +yMode := 281 + ; 0.23 ascend button xAscend := 1121 yAscend := 322 @@ -270,7 +278,7 @@ clientCheck() { fullScreenOption := false if (useImageSearch and locateImage(imgQuality, xPos, yPos)) { - showDebugSplash("Switching to low quality...") + showDebugSplash("Switching to low quality") clickPos(xPos, yPos, 1, 1) } } @@ -282,7 +290,7 @@ calculateBrowserOffsets() { winName := "Lvl.*Clicker Heroes.*" . browser IfWinExist, % winName { - showSplash("Calculating browser offsets...", 1, 0) + showDebugSplash("Calculating browser offsets (" . scriptName . ")") WinActivate WinGetPos, xWinPos, yWinPos, w, h WinGet, chWinId, ID, A @@ -312,16 +320,16 @@ calculateSteamAspectRatio() { ; Fullscreen sanity checks if (fullScreenOption) { if (w <> A_ScreenWidth || h <> A_ScreenHeight) { - showWarningSplash("Set the fullScreenOption to false in the bot lib file.") + showWarningSplash("The fullScreenOption should be set to false!") return } } else if (w = A_ScreenWidth && h = A_ScreenHeight) { - showWarningSplash("Set the fullScreenOption to true in the bot lib file.") + showWarningSplash("The fullScreenOption should be set to true!") return } if (w != chTotalWidth || h != chTotalHeight) { - showSplash("Calculating Steam aspect ratio...", 1, 0) + showDebugSplash("Calculating Steam aspect ratio (" . scriptName . ")") local winWidth := fullScreenOption ? w : w - 2 * chMargin local winHeight := fullScreenOption ? h : h - chTopMargin - chMargin @@ -461,23 +469,21 @@ playWarningSound() { } showDebugSplash(text, seconds:=1) { - if (debug) { - showSplash(text, seconds, 0) - } + showSplash(text, seconds, 0, "DEBUG") } -showSplashAlways(text, seconds:=2) { - showSplash(text, seconds, 1, 1) +showUserSplash(text, seconds:=2) { + showSplash(text, seconds, 1, "USER") } -showWarningSplash(text, seconds:=5) { - showSplash(text, seconds, 2, 1) +showWarningSplash(text, seconds:=4) { + showSplash(text, seconds, 2, "WARN") } -showSplash(text, seconds:=2, sound:=1, showAlways:=0) { +showSplash(text, seconds:=2, sound:=1, level="INFO") { global if (seconds > 0) { - if (showSplashTexts or showAlways) { + if (severityLevels[level] <= showSeverityLevel) { progress,% "w" wSplash " x" xSplash " y" ySplash " zh0 fs10", %text%,,% script } if (sound = 1) { @@ -488,6 +494,41 @@ showSplash(text, seconds:=2, sound:=1, showAlways:=0) { sleep % seconds * 1000 progress, off } + logger(text, level) +} + +logArray(name, array) { + local value := "" + loop % array.Length() + { + value .= array[A_Index] + if (A_Index < array.Length()) { + value .= ", " + } + } + logVariable(name, "[" . value . "]") +} + +logVariable(name, value, isBool:=0) { + if (isBool) { + value := value ? "true" : "false" + } + logger(name . " = " . value, "DEBUG") +} + +; 0:OFF, 1:WARN, 2:USER, 3:INFO, 4:DEBUG +logger(msg, level) { + global + local localTime := A_Now + local currentDate + local currentDateTime + local fileName + if (severityLevels[level] <= logSeverityLevel) { + FormatTime, currentDate, localTime, yyyy-MM-dd + FormatTime, currentDateTime, localTime, yyyy-MM-dd HH:mm:ss + fileName := "logs\" . currentDate . ".txt" + FileAppend, % currentDateTime . "`t" . level . "`t" . msg . "`n", %fileName% + } } startProgress(title, min:=0, max:=100) { @@ -533,7 +574,7 @@ secondsSince(startTime) { toggleFlag(flagName, byref flag) { flag := !flag flagValue := flag ? "On" : "Off" - showSplashAlways("Toggled " . flagName . " " . flagValue) + showUserSplash("Toggled " . flagName . " " . flagValue) } screenShot() { @@ -548,10 +589,13 @@ screenShot() { } } -scrollToZone(fromZone, toZone) { +scrollToZone(zone) { + scrollZone(getCurrentZone(), zone) +} + +scrollZone(fromZone, toZone) { global - local currentZone := getCurrentZone() - local zones := currentZone > 0 ? toZone - currentZone : toZone - fromZone + local zones := toZone - fromZone local xZone := zones > 0 ? xNextZone : xPrevZone if (zones != 0) { @@ -609,28 +653,30 @@ reFocus() { ; screen. The CH window is required to be visible and in default size for this to work. ; ----------------------------------------------------------------------------------------- -upLocator(image, what, byref xPos, byref yPos, clickCount:=5, retries:=-1, absolute:=0, startAt:=0) { - return locator(image, what, xPos, yPos, clickCount, retries, absolute, startAt, 1) +upLocator(image, what, byref xPos, byref yPos, retries:=0, clickCount:=5, absolute:=0, startAt:=0, earlyGameMode:=0) { + return locator(image, what, xPos, yPos, retries, clickCount, absolute, startAt, earlyGameMode, 1) } ; Try to locate the given image one screen at a time -locator(image, what, byref xPos, byref yPos, clickCount:=5, retries:=-1, absolute:=0, startAt:=0, directionUp:=0) { +locator(image, what, byref xPos, byref yPos, retries:=0, clickCount:=5, absolute:=0, startAt:=0, earlyGameMode:=0, directionUp:=0) { global local attempts := ceil(45 / clickCount) local attempt := 0 while (!locateImage(image, xPos, yPos, absolute, startAt, directionUp)) { - if (++attempt <= attempts) { + if (++attempt <= attempts and !locateImage(imgCid)) { if (directionUp) { scrollUp(clickCount) startAt := 0 ; only offset once } else { scrollDown(clickCount) } - } else if (retries < 0 or --retries > 0) { - showDebugSplash("Could not locate " . what . "! Trying again...") - clientCheck() + } else if (retries-- != 0) { + if (!earlyGameMode) { + showDebugSplash("Could not locate " . what . "! Trying again...") + clientCheck() + } if (directionUp) { scrollToBottom() } else { @@ -712,7 +758,7 @@ locateImageDown(image, byref xPos:="", byref yPos:="", absolute:=0, topOffset:=0 ImageSearch xPos, yPos, xL, yT, xR, yB, *30 %imageFile% if (ErrorLevel = 2) { playWarningSound() - msgbox,,% script,% "ImageSearch failed! Could not open: " . %imageFile% + msgbox,,% script,% "ImageSearch failed! Could not open: " . imageFile exit } else if (ErrorLevel = 0 and !absolute) { ; Absolute --> Relative diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index 1249e0a..9ef8772 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -15,11 +15,12 @@ SetControlDelay, -1 scriptName=CH Sw1ft Bot scriptVersion=3.x -minLibVersion=1.4 +minLibVersion=1.5 script := scriptName . " v" . scriptVersion -clickerName := "monster_clicker.ahk - AutoHotkey" +clickerScript := "monster_clicker.ahk" +clickerName := clickerScript . " - AutoHotkey" scheduleReload := false scheduleStop := false @@ -50,13 +51,27 @@ if (!useImageSearch and irisLevel < 145) { exit } +SysGet, VirtualScreenWidth, 78 +SysGet, VirtualScreenHeight, 79 + +logVariable("A_AhkVersion", A_AhkVersion) +logVariable("A_OSVersion", A_OSVersion) +logVariable("A_ScreenWidth", A_ScreenWidth) +logVariable("A_ScreenHeight", A_ScreenHeight) +if (VirtualScreenWidth > A_ScreenHeight) { + logVariable("VirtualScreenWidth", VirtualScreenWidth) + logVariable("VirtualScreenHeight", VirtualScreenHeight) +} +logVariable("A_ScreenDPI", A_ScreenDPI ) +logVariable("script", script) + clientCheck() if (deepRunClicks) { - Run, "%A_ScriptDir%\monster_clicker.ahk",, UseErrorLevel + Run, "%A_ScriptDir%\%clickerScript%",, UseErrorLevel if (ErrorLevel != 0) { playWarningSound() - msgbox,,% script,% "Failed to auto-start monster_clicker.ahk (system error code = " . A_LastError . ")!" + msgbox,,% script,% "Failed to auto-start " . clickerScript . " (system error code = " . A_LastError . ")!" } } @@ -80,17 +95,17 @@ return ; -- Main Hotkeys ------------------------------------------------------------------------- -; Start the Speed run loop with Ctrl+F1 +; Start the Speed Run loop with Ctrl+F1 ^F1:: loopSpeedRun() return -; Start a Deep run with Ctrl+F2 (expecting to start where a Speed run finishes) +; Start a Deep Run with Ctrl+F2 (expecting to start where a Speed Run finishes) ^F2:: deepRun() return -; Start a Vision run loop with Ctrl+F3 +; Start a Vision Run loop with Ctrl+F3 ^F3:: loopVisionRun() return @@ -101,7 +116,7 @@ return ; Abort any active run or initiated ascension with Alt+Pause !Pause:: - showSplashAlways("Aborting...") + showUserSplash("Aborting...") exitThread := true return @@ -125,6 +140,7 @@ return ; Re-initialize coordinates (needed after moving or re-sizing the client window) !F6:: critical + showUserSplash("Re-initialize coordinates... ") clientCheck() clickerInitialize() return @@ -144,13 +160,13 @@ return ; Set previous ranger as re-gild target ^F6:: reGildRanger := reGildRanger > rangers.MinIndex() ? reGildRanger-1 : reGildRanger - showSplashAlways("Re-gild ranger set to " . rangers[reGildRanger]) + showUserSplash("Re-gild ranger set to " . rangers[reGildRanger]) return ; Set next ranger as re-gild target ^F7:: reGildRanger := reGildRanger < rangers.MaxIndex() ? reGildRanger+1 : reGildRanger - showSplashAlways("Re-gild ranger set to " . rangers[reGildRanger]) + showUserSplash("Re-gild ranger set to " . rangers[reGildRanger]) return ; Move "reGildCount" gilds to the target ranger @@ -201,10 +217,6 @@ return toggleFlag("autoAscend", autoAscend) return -+^F2:: - toggleFlag("screenShotRelics", screenShotRelics) -return - +^F6:: toggleFlag("playNotificationSounds", playNotificationSounds) return @@ -213,18 +225,10 @@ return toggleFlag("playWarningSounds", playWarningSounds) return -+^F8:: - toggleFlag("showSplashTexts", showSplashTexts) -return - +^F11:: toggleFlag("saveBeforeAscending", saveBeforeAscending) return -+^F12:: - toggleFlag("debug", debug) -return - ; -- Test Hotkeys ------------------------------------------------------------------------- ; Ctrl+Alt+F1 should scroll down to the bottom @@ -238,7 +242,7 @@ return switchToCombatTab() return -; Alt+F1 to F4 are here to test the individual parts of the full speed run loop +; Alt+F1 to F4 are here to test the individual parts of the full Speed Run loop !F1:: getClickable() @@ -257,12 +261,12 @@ return ascend(autoAscend) return -; Test one Midas start with Win+F1 +; Test one Midas Start with Win+F1 #F1:: midasStart() return -; Loop Midas start > init run > ascend, twice +; Loop Midas Start > Init Run > Ascend, twice #F2:: loop 2 { @@ -288,7 +292,7 @@ testLocate(image, clickCount:=5) { global local x, y msgbox,,% script,% "Locate " . image.file . "?" - if (locator(image, image.file, x, y, clickCount, 1)) { + if (locator(image, image.file, x, y, 1, clickCount)) { ; one retry msgbox,,% script,% "Success! (" . x . ", " . y . ")" } else { msgbox,,% script,% "Failed!" @@ -319,7 +323,6 @@ testLocate(image, clickCount:=5) { testSearch(imgGoldenClicks, "Lvl Midas to 100") testSearch(imgAscend, "Lvl Amenhotep to 150") testLocate(imgDK) - testSearch(imgFrigidEnchant, "Lvl Frostleaf to 100") msgbox,,% script,% "Locate " . imgGilded.file . "?" if (locateGilded(x, y, isNew)) { @@ -340,9 +343,13 @@ return ; ----------------------------------------------------------------------------------------- ; Level up and upgrade all heroes -initRun() { +initRun(initMode:=0) { global - local hasLeveledHeroes := false + local hasAscendButton := false + local hasSkillBar := false + local hasNoSkillLocked := false + + showDebugSplash("Init Run @ Lvl " . getCurrentZone()) switchToCombatTab() reFocus() @@ -358,12 +365,15 @@ initRun() { } else { local foundDK := false local xButton, yButton, xDK, yDK, x + local clickCount := initMode = 1 ? 1 : 2 locateImage(imgCoin, xButton, yButton) ; get a x coordinate for the hire/lvl up buttons - loop 9 ; pages + loop 10 ; pages { - foundDK := locateImage(imgDK, xDK, yDK) + if (locateImage(imgDK, xDK, yDK) or locateImage(imgDKG, xDK, yDK)) { + foundDK := true + } loop 5 ; attempts per page { if (locateImage(imgDimmedSkill, x, yButton) @@ -372,14 +382,14 @@ initRun() { ; Don't level anything below Frostleaf continue } - ctrlClick(xButton, yButton, 2, 1, 1) + ctrlClick(xButton, yButton, clickCount, 1, 1) } else { break } } if (foundDK) { - if (locateImage(imgFrigidEnchant) and locateImage(imgAscend)) { - hasLeveledHeroes := true + if (locateImage(imgAscend)) { + hasAscendButton := true } break } @@ -389,7 +399,19 @@ initRun() { scrollToBottom() buyAvailableUpgrades() - return useImageSearch ? hasLeveledHeroes and locateImage(imgSkillBar) and !locateImage(imgSkillLocked) : 1 + if (useImageSearch and initMode = 0) { + if (locateImage(imgSkillBar)) { + hasSkillBar := true + } + if (!locateImage(imgSkillLocked)) { + hasNoSkillLocked := true + } + logVariable("hasAscendButton", hasAscendButton, true) + logVariable("hasSkillBar", hasSkillBar, true) + logVariable("hasNoSkillLocked", hasNoSkillLocked, true) + } + + return useImageSearch ? hasAscendButton and hasSkillBar and hasNoSkillLocked : 1 } upgrade(clickCount:=1) { @@ -420,6 +442,8 @@ midasStart() { local fromZone := midasExtraZone > 0 ? midasExtraZone : midasZone1 + showDebugSplash("Midas Start") + switchToCombatTab() startMonitoring() reFocus() @@ -429,7 +453,7 @@ midasStart() { clickPos(xMonster, yMonster) ; Break idle sleep 30 } - scrollToZone(1, midasZone1) + scrollZone(1, midasZone1) ctrlClick(xl, yl) ; Cid x 100 clickPos(xSkill + oSkill, ySkillTop) ; Clickstorm sleep % zzz @@ -440,12 +464,12 @@ midasStart() { ctrlClick(xl, yl+oLvl) ; Natalia x 100 if (midasExtraZone > 0) { - scrollToZone(midasZone1, midasExtraZone) + scrollZone(midasZone1, midasExtraZone) horizontalSkills(xSkill, ySkill2nd, 4) sleep % midasExtraDelay * 1000 } scrollDown(8) - scrollToZone(fromZone, midasZone2) + scrollZone(fromZone, midasZone2) ctrlClick(xl, yl+oLvl) ; Broyle x 100 sleep % midasDelay2 * 1000 ctrlClick(xl, yl+oLvl*3) ; Midas x 100 @@ -455,34 +479,30 @@ midasStart() { activateSkills("1-4-5") sleep % coinPickUpDelay * 1000 } else { - if (locateImage(imgProgression)) { - showDebugSplash("Toggle farm mode") - toggleMode() - } - scrollToZone(1, midasZone1) - locator(imgCid, "Cid", xl, yl) + setFarmMode() + scrollToZone(midasZone1) + locator(imgCid, "Cid", xl, yl, -1) ; endless retries buySkill(imgClickstorm, xl-137, yl+60, 2, 7) scrollToBottom() - upLocator(imgCoin, "Coin", xl, yl) + upLocator(imgCoin, "Coin", xl, yl, -1) ; endless retries ctrlClick(xl, yl, 1, 1, 1) sleep % midasDelay1 * 1000 ctrlClick(xl, yl, 1, 1, 1) if (midasExtraZone > 0) { - scrollToZone(midasZone1, midasExtraZone) + scrollToZone(midasExtraZone) sleep % midasExtraDelay * 1000 ctrlClick(xl, yl, 1, 1, 1) } if (locateImage(imgMercedes)) { scrollDown(8) } else { - showDebugSplash("Unknown location, relocating...") switchToCombatTab() scrollDown(18) } - scrollToZone(fromZone, midasZone2) - if (!locator(imgReferi, "Referi", xl, yl, 2, 1)) { - showDebugSplash("Failed Midas start!") + scrollToZone(midasZone2) + if (!locator(imgReferi, "Referi", xl, yl, 1, 2)) { ; one retry + showWarningSplash("Failed Midas start!") return } xl -= 155 @@ -491,7 +511,7 @@ midasStart() { sleep % midasDelay2 * 1000 buySkill(imgGoldenClicks, xl, yl-oLvl, 5, 6) - toggleMode() + setProgressionMode() activateSkills("1-4-5") sleep % coinPickUpDelay * 1000 zClick(xl, yl-oLvl, 1, 1) ; Midas 125 @@ -545,7 +565,7 @@ getState() { if (!locateImage(imgSmile)) { return 0 ; vision, but not finding anything } - if (!locateImage(imgProgression) and getCurrentZone() < irisLevel) { + if (!earlyGameMode and !locateImage(imgProgression) and getCurrentZone() < irisLevel) { return 1 ; ready to start } if (getCurrentZone() < getEndZone()) { @@ -557,8 +577,50 @@ getState() { loopVisionRun() { global + if (earlyGameMode) { + oldEndLvlIdle := endLvlIdle + oldEndLvlActive := endLvlActive + } local state := 0 - showSplash("Starting vision runs...") + + showUserSplash("Starting Vision Runs!") + + logVariable("browser", browser) + logVariable("browserTopMargin", browserTopMargin) + logVariable("useImageSearch", useImageSearch, true) + logVariable("earlyGameMode", earlyGameMode, true) + if (!earlyGameMode) { + logVariable("irisLevel", irisLevel) + logVariable("gildedRanger", rangers[gildedRanger]) + } + logVariable("endLvlIdle", endLvlIdle) + logVariable("endLvlActive", endLvlActive) + if (!earlyGameMode) { + logVariable("useMidasStart", useMidasStart, true) + logVariable("forcedMidasStart", forcedMidasStart, true) + logArray("midasZoneConfig", midasZoneConfig) + if (!isActiveZone(irisLevel)) { + logVariable("activateSkillsAtStart", activateSkillsAtStart, true) + if (activateSkillsAtStart) { + logArray("speedRunStartCombo", speedRunStartCombo) + } + } + } + logVariable("deepRunClicks", deepRunClicks, true) + if (endLvlActive > 0) { + logArray("deepRunCombo", deepRunCombo) + logVariable("clickableHuntDelay", clickableHuntDelay) + logVariable("stopHuntThreshold", stopHuntThreshold) + } + logVariable("clickerDuration", clickerDuration) + logVariable("saveBeforeAscending", saveBeforeAscending, true) + logVariable("autoAscend", autoAscend, true) + if (!earlyGameMode) { + logVariable("levelSolomon", levelSolomon, true) + if (levelSolomon) { + logVariable("solomonLevels", solomonLevels) + } + } loop { @@ -570,24 +632,21 @@ loopVisionRun() { continue } if (state = 1) { - if (hasClickable()) { - showDebugSplash("(1) Clickable start...") + if (!forcedMidasStart and hasClickable()) { + showDebugSplash("Clickable start") getClickable(useImageSearch) sleep % coinPickUpDelay * 1000 switchToCombatTab() ctrlClick(xLvl, yLvl+oLvl) ; Force progression - toggleMode() + setProgressionMode() } else { - showDebugSplash("(1) Midas start...") midasStart() } } if (getState() = 2) { - showDebugSplash("(2) Progressing...") visionRun() } if (getState() = 3) { - showDebugSplash("(3) Ascending...") if (saveBeforeAscending) { save() } @@ -606,9 +665,7 @@ visionRun() { exitThread := false isResuming := false - showSplash("Starting vision run...", 1, 0) - startMonitoring() - reFocus() + local startTime := A_TickCount local isInitiated := false local isClickerRunning := false @@ -620,51 +677,117 @@ visionRun() { local xBtn := 0, yBtn := 0, isNew := 0 local xSkill := 0, ySkill := 0, skillSearch := false + local locateGildedDelay := 90 + local locateBuyUpgradesDelay := 20 + local progressCheckDelay := 10 + local zone := getCurrentZone() - local startZone := zone - local initZone := 145 + zoneTicks := {} + local maxZone := zone + local initiatedZone := 0 + farmZone := 0 + local initZone := 146 local endZone := getEndZone() local stopHuntZone := endZone - ceil(stopHuntThreshold * 250 / 7) local t := 0 + local elapsedTime := 0 local comboDelay := deepRunCombo[1] comboIndex := 2 + if (earlyGameMode) { + endLvlIdle := oldEndLvlIdle + endLvlActive := oldEndLvlActive + locateGildedDelay := 6 + lvlUpDelay := 6 + } + local startAt := 0 + local timeToAscend := 0 + local zoneClearTime := 0 + secPerMonster := 0 + farmTime := 0 + isFarming := false + + local mode := earlyGameMode ? "Early Game Mode " : "" + showSplash("Starting " . mode . "Vision Run") + + startMonitoring() + reFocus() + startProgress("Vision Run", zone // barUpdateDelay, endZone // barUpdateDelay) + SetTimer, zoneTickTimer, 500 + loop { if (exitThread) { + zoneTicks := "" + SetTimer, zoneTickTimer, off SetTimer, comboTimer, off clickerStop() stopProgress() stopMonitoring() - showSplashAlways("Vision run aborted!") + showUserSplash("Vision Run aborted!") exit } - if (mod(t, 15) = 0) { - ; Make sure we are progressing - if (!locateImage(imgProgression)) { - showDebugSplash("Toggle progression mode") - toggleMode() + + ; Gief moar rubies plox! + if (mod(t, clickableHuntDelay) = 0 and zone < stopHuntZone) { + getClickable(useImageSearch) + } + + ; Early game mode until "power 5" zone + if (earlyGameMode and zone < power5Zone) { + if (mod(t, locateBuyUpgradesDelay) = 0 or isResuming) { + ; Scroll down when loosing track of the upgrades button + if (!locateImage(imgBuyUpgrades)) { + scrollToBottom() + sleep % coinPickUpDelay + buyAvailableUpgrades() + } + skillSearch := true + isResuming := false } - if (!isInitiated and zone > initZone) { - ; If enough gold, run init - showDebugSplash("Initializing...") - isInitiated := initRun() - isResuming := true + if (mod(t, lvlUpDelay) = 0) { + ; Level heroes bottom up + if (locateImageUp(imgCoin, xBtn, yBtn)) { + xBtn := 79 + yBtn -= 8 + } } - } - ; Traverse bottom up till we find the first gilded hero/ranger we can lvl up - if (mod(t, 90) = 0 or isResuming) { - if (locateGilded(xBtn, yBtn, isNew)) { + if (zone > 30 and zone > initiatedZone and mod(zone-6, 30) = 0 and zone < initZone) { + ; Lvl earlier heroes at zones 36, 66, 96 and 126 + initRun(1) ; x 100 + initiatedZone := zone + } + ; xx4/xx9 zone before boss? + if (zone > 10 and zone > farmZone and mod(zone-4, 5) = 0 and zone <= lastFarmZone and !isFarming) { + ; If the previous zone took 2s or more per monster, start farming + zoneClearTime := (zoneTicks[zone] - zoneTicks[zone-1]) / 1000 + secPerMonster := zoneClearTime / (10 - kumawakamaruLevel) + if (secPerMonster >= 2) { + farmTime := ceil(secPerMonster * 25) ; 20, 25 or 30? + showDebugSplash("Farming for " . farmTime . "s") + setFarmMode(1) + SetTimer, farmTimer, % -farmTime * 1000, 1 + isFarming := true + farmZone := zone + } + } + } else if (mod(t, locateGildedDelay) = 0 or isResuming) { + ; Traverse bottom up till we find the first gilded hero/ranger we can lvl up + if (locateGilded(xBtn, yBtn, isNew, startAt, earlyGameMode)) { maxClick(xBtn, yBtn, 1, 1) if (isNew) { - showDebugSplash("New gilded hero found") + showDebugSplash("New gilded hero found @ Lvl " . zone) sleep % coinPickUpDelay buyAvailableUpgrades() } + if (earlyGameMode) { + ; Power 5 mode + startAt := yBtn + yWinPos - 56 + } skillSearch := true isResuming := false } else { @@ -672,105 +795,221 @@ visionRun() { if (locateImage(imgClose, xClose, yClose)) { clickPos(xClose, yClose, 1, 1) } else { - showWarningSplash("No transitional ranger gilded?") + showWarningSplash("Could not locate any gilded hero! Restarting...") ; Restart - scrollToZone(zone, irisLevel - 1) - toggleMode() + scrollToZone(irisLevel - 1) + setFarmMode() break } } } - zone := getCurrentZone() + + if (!isInitiated and zone >= initZone) { + ; If enough gold, run init + isInitiated := initRun() + isResuming := true + } + + ; Make sure we are progressing + if (mod(t, progressCheckDelay) = 0) { + if (!locateImage(imgProgression) and !isFarming) { + if (earlyGameMode and zone > lastFarmZone) { + ; Brute force through two bosses with skills, then ascend + if (++timeToAscend >= 2) { + showDebugSplash("Ascend after next boss") + endLvlIdle := zone + 1 + endLvlActive := zone + 1 + endZone := getEndZone() + } + showDebugSplash("Push with skills! (" . timeToAscend . "/2) @ Lvl " . zone) + if (!isClickerRunning) { + clickerStart(clickerDuration) + } + Gosub, comboTimer + } + setProgressionMode() + } + } + ; Active zone? - if (zone > endLvlIdle) { + if (isActiveZone(zone)) { if (deepRunClicks) { if (!isClickerRunning) { ; Yup, start hammering! - showDebugSplash("Start external clicker") clickerStart() ; ~38 CPS isClickerRunning := true - Gosub, comboTimer - SetTimer, comboTimer, % comboDelay * 1000 + 250 + if (!earlyGameMode) { + ; Save skill combos till after lastFarmZone + Gosub, comboTimer + SetTimer, comboTimer, % comboDelay * 1000 + 250 + } } clickPos(xMonster, yMonster) ; Jugg combo safety click sleep 30 } - ; If option enabled, activate skills once at start - } else if (zone = startZone and activateSkillsAtStart and !hasActivatedSkills and isInitiated) { - showDebugSplash("Activate skills at start") + } else if (isClickerRunning) { + clickerStop() + isClickerRunning := false + } else if (zone = irisLevel + 1 and activateSkillsAtStart and !hasActivatedSkills and isInitiated) { + ; If option enabled, activate skills once at start (if fully initiated) + showDebugSplash("Activate skills at start!") + clickerStart(clickerDuration) activateSkills(speedRunStartCombo[2]) hasActivatedSkills := true } + ; Level up... - if (matchPixelColor(blueColor, xBtn+xWinPos, yBtn+yWinPos)) { - if (!hasBomberBuff and zone > 2930) { - getBuff(imgMax, hasBomberBuff, skillSearch) - } else if (!hasGogBuff and zone > 3210) { - getBuff(imgGog, hasGogBuff, skillSearch) - } - if (skillSearch) { - ; Aquire possible new skills - while (locateImage(imgSkill, xSkill, ySkill)) { - clickPos(xSkill, ySkill, 1, 1) - sleep 500 + if (mod(t, lvlUpDelay) = 0 and !isResuming) { + if (matchPixelColor(blueColor, xBtn+xWinPos, yBtn+yWinPos)) { + ; Get Bomber Max and Gog global gold and dps buffs when we can + if (!hasBomberBuff and zone > 2930) { + getBuff(imgMax, hasBomberBuff, skillSearch) + } else if (!hasGogBuff and zone > 3210) { + getBuff(imgGog, hasGogBuff, skillSearch) } - if (!locateImage(imgDimmedSkill)) { - skillSearch := false + if (skillSearch) { + ; Aquire possible new skills + while (locateImage(imgSkill, xSkill, ySkill)) { + clickPos(xSkill, ySkill, 1, 1) + sleep 500 + } + if (!locateImage(imgDimmedSkill)) { + skillSearch := false + } } - } - ; ... when we can afford to do so - ctrlClick(xBtn, yBtn, 2, 1, 1) - } else if (!matchPixelColor(goldColor, xBtn-51+xWinPos, yBtn+yWinPos)) { - if (!matchPixelColor(brightGoldColor, xBtn-51+xWinPos, yBtn+yWinPos)) { - ; ... or not, lost sight of our gilded hero - showDebugSplash("Lost sight of our gilded hero") - if (!locateImage(imgCombat)) { - switchToCombatTab() + ; ... when we can afford to do so + ctrlClick(xBtn, yBtn, 2, 1, 1) + } else if (!earlyGameMode and !matchPixelColor(goldColor, xBtn-51+xWinPos, yBtn+yWinPos)) { + if (!matchPixelColor(brightGoldColor, xBtn-51+xWinPos, yBtn+yWinPos)) { + ; ... or not, lost sight of our gilded hero + showDebugSplash("Lost sight of our gilded hero!") + if (!locateImage(imgCombat)) { + switchToCombatTab() + } + isResuming := true } - isResuming := true } } - ; Let's go fishing! - if (mod(t, clickableHuntDelay) = 0 and zone < stopHuntZone) { - getClickable(useImageSearch) + + zone := getCurrentZone() + if (zone > maxZone) { + maxZone := zone } + t += 1 updateProgress(zone // barUpdateDelay, endZone - zone, 1) ; show lvls remaining sleep 1000 - } until zone >= endZone + } until zone > endZone + + if (earlyGameMode) { + maxLevels() ; get some extra souls from levels + } + + zoneTicks := "" + SetTimer, zoneTickTimer, off SetTimer, comboTimer, off clickerStop() stopProgress() stopMonitoring() - showSplash("Vision run completed.") + elapsedTime := (A_TickCount - startTime) / 1000 + showSplash("Vision Run duration: " . formatSeconds(elapsedTime)) +} + +isActiveZone(zone) { + global + if (zone <= endLvlActive) { + if (endLvlIdle < endLvlActive and zone <= endLvlIdle) { + return false + } + return true + } + return false } getBuff(image, byref hasBuff, byref skillSearch) { scrollToBottom() - if (upLocator(image, image.file, xImg, yImg, 5, 1)) { + if (upLocator(image, image.file, xImg, yImg)) { ctrlClick(xImg-320, yImg+43, 2, 1, 1) ; hire skillSearch := true } hasBuff := true } +; Max levels early game for some extra souls +maxLevels() { + global + + showDebugSplash("Max levels for souls") + + switchToCombatTab() + reFocus() + + local xButton, yButton + ControlSend,, {shift down}{vk51 down}, ahk_id %chWinId% ; {q}, {vk51} or {sc010} + loop 9 ; pages + { + loop 10 ; attempts per page + { + if (locateImage(imgMaxLvl, xButton, yButton)) { + clickPos(xButton, yButton, 1, 1) + } + sleep 300 + } + scrollDown(5) + } + ControlSend,, {vk51 up}{shift up}, ahk_id %chWinId% +} + loopSpeedRun() { global - local mode := hybridMode ? "hybrid" : "speed" - showSplash("Starting " . mode . " runs...") + local mode := hybridMode ? "Hybrid" : "Speed" + showUserSplash("Starting " . mode . " Runs!") + + if (A_TitleMatchMode = "regex") { + logVariable("browser", browser) + logVariable("browserTopMargin", browserTopMargin) + } + logVariable("useImageSearch", useImageSearch, true) + logVariable("irisLevel", irisLevel) + logVariable("gildedRanger", rangers[gildedRanger]) + logVariable("speedRunTime", speedRunTime) + logVariable("firstStintAdjustment", firstStintAdjustment) + logVariable("firstStintButton", firstStintButton) + logVariable("useMidasStart", useMidasStart, true) + if (useMidasStart) { + logArray("midasZoneConfig", midasZoneConfig) + } + logVariable("activateSkillsAtStart", activateSkillsAtStart, true) + if (activateSkillsAtStart) { + logArray("speedRunStartCombo", speedRunStartCombo) + } + logVariable("deepRunClicks", deepRunClicks, true) + logVariable("hybridMode", hybridMode, true) + if (hybridMode) { + logVariable("deepRunTime", deepRunTime) + logArray("deepRunCombo", deepRunCombo) + logVariable("clickableHuntDelay", clickableHuntDelay) + logVariable("stopHuntThreshold", stopHuntThreshold) + } + logVariable("clickerDuration", clickerDuration) + logVariable("saveBeforeAscending", saveBeforeAscending, true) + logVariable("autoAscend", autoAscend, true) + loop { if (useMidasStart) { midasStart() getClickable() } else { + showDebugSplash("Clickable start") getClickable() sleep % coinPickUpDelay * 1000 } initRun() if (activateSkillsAtStart) { + clickerStart(clickerDuration) activateSkills(speedRunStartCombo[2]) } speedRun() @@ -791,6 +1030,7 @@ loopSpeedRun() { speedRun() { global + local startTime := A_TickCount local stint := 0 local stints := 0 local tMax := 7 * 60 ; seconds @@ -814,43 +1054,22 @@ speedRun() { local lastStintButton := gildedRanger = 14 ? 3 : 2 ; special case for Wepwawet - if (debug) - { - local nl := "`r`n" - local s := " " ; Reddit friendly formatting - local output := "" - output .= s . "irisLevel = " . irisLevel . nl - output .= s . "speedRunTime = " . speedRunTime . nl - if (hybridMode) { - output .= s . "deepRunTime = " . deepRunTime . nl - } - output .= s . "gildedRanger = " . rangers[gildedRanger] . nl - output .= s . "firstStintAdjustment = " . firstStintAdjustment . "s" . nl - output .= s . "firstStintButton = " . firstStintButton . nl - output .= s . "-----------------------------" . nl - output .= s . "lvlAdjustment = " . lvlAdjustment . nl - output .= s . "zoneLvl = " . zoneLvl . nl - output .= s . "lvls = " . lvls . nl - output .= s . "firstStintTime = " . formatSeconds(firstStintTime) . nl - output .= s . "lastStintTime = " . formatSeconds(lastStintTime) . nl - output .= s . "totalClickDelay = " . formatSeconds(totalClickDelay) . nl - - clipboard := % output - msgbox % output - return - } + showSplash("Starting Speed Run") - showSplash("Starting speed run...") + logVariable("zoneLvl", formatSeconds(zoneLvl)) + logVariable("firstStintTime", formatSeconds(firstStintTime)) + logVariable("lastStintTime", formatSeconds(lastStintTime)) scrollToBottom() toggleMode(!useMidasStart) ; toggle to progression mode if (firstStintTime > 0) { lvlUp(firstStintTime, 1, firstStintButton, ++stint, stints) - scrollWayDown(5) + scrollWayDown(6) } lvlUp(lastStintTime, 1, lastStintButton, ++stint, stints) - showSplash("Speed run completed.") + local elapsedTime := (A_TickCount - startTime) / 1000 + showSplash("Speed Run duration: " . formatSeconds(elapsedTime)) } lvlUp(seconds, buyUpgrades, button, stint, stints) { @@ -862,6 +1081,7 @@ lvlUp(seconds, buyUpgrades, button, stint, stints) { startMonitoring() startProgress(title, 0, seconds // barUpdateDelay) + showDebugSplash(title . " @ Lvl " . getCurrentZone()) if (buyUpgrades) { ctrlClick(xLvl, y) @@ -876,7 +1096,7 @@ lvlUp(seconds, buyUpgrades, button, stint, stints) { if (exitThread) { stopProgress() stopMonitoring() - showSplashAlways("Speed run aborted!") + showUserSplash("Speed Run aborted!") exit } ; Close possible auto-opened buy more rubies window @@ -901,11 +1121,12 @@ deepRun() { global exitThread := false + local startTime := A_TickCount local drDuration := deepRunTime * 60 local button := gildedRanger = 14 ? 3 : 2 ; special case for Wepwawet local y := yLvl + oLvl * (button - 1) - showSplash("Starting deep run...") + showSplash("Starting Deep Run") startMonitoring() startProgress("Deep Run Progress", 0, drDuration // barUpdateDelay) @@ -914,6 +1135,7 @@ deepRun() { local comboDelay := deepRunCombo[1] local comboIndex := 2 local stopHuntIndex := drDuration - stopHuntThreshold * 60 + local t := 0 loop % drDuration @@ -922,7 +1144,7 @@ deepRun() { clickerStop() stopProgress() stopMonitoring() - showSplashAlways("Deep run aborted!") + showUserSplash("Deep Run aborted!") exit } ; Close possible auto-opened buy more rubies window @@ -951,11 +1173,15 @@ deepRun() { stopProgress() stopMonitoring() - showSplash("Deep run ended.") + local elapsedTime := (A_TickCount - startTime) / 1000 + showSplash("Deep Run duration: " . formatSeconds(elapsedTime)) } -clickerStart() { +clickerStart(duration := 0) { sendClickerMsg(WM_CLICKER_START) + if (duration > 0) { + SetTimer, clickerStopTimer, % -duration * 1000 + } } clickerPause() { @@ -964,6 +1190,7 @@ clickerPause() { clickerStop() { sendClickerMsg(WM_CLICKER_STOP) + sleep 1000 } clickerReload() { @@ -993,7 +1220,7 @@ sendClickerMsg(msg, wait:=0) { if (ErrorLevel != "FAIL") { reply := ErrorLevel } else { - showWarningSplash("SendMessage failed! monster_clicker.ahk started?") + showWarningSplash("SendMessage failed! " . clickerScript . " started?") } } DetectHiddenWindows,% dhw @@ -1016,6 +1243,11 @@ save() { local fileName := "ch" . A_NowUTC . ".txt" local newFileName := "" + showDebugSplash("Save to " . fileName) + + ; Close possible other dialog box + ControlSend,, {esc}, ahk_class %dialogBoxClass% + openSaveDialog() ; Change the file name... @@ -1085,7 +1317,7 @@ ascend(autoYes:=false) { if (exitThread) { exitThread := false stopMonitoring() - showSplashAlways("Ascension aborted!") + showUserSplash("Ascension aborted!") exit } } @@ -1095,12 +1327,14 @@ ascend(autoYes:=false) { ifmsgbox no { stopMonitoring() + showUserSplash("Salvage aborted!") exit } } salvageJunkPile() ; must salvage junk relics before ascending - toggleMode() + + showDebugSplash("Ascend @ Lvl " . getCurrentZone()) clickPos(xAscend, yAscend) ; 0.23 ascend button sleep % zzz * 4 @@ -1128,7 +1362,7 @@ salvageJunkPile() { showWarningSplash("Salvaging junk in " . displayRelicsDuration . " seconds! (Abort with Alt+Pause)", displayRelicsDuration) if (exitThread) { exitThread := false - showSplashAlways("Salvage aborted!") + showUserSplash("Salvage aborted!") exit } } @@ -1140,6 +1374,8 @@ salvageJunkPile() { } } + showDebugSplash("Salvage Junk Pile") + clickPos(xSalvageJunk, ySalvageJunk) sleep % zzz * 4 clickPos(xDestroyYes, yDestroyYes) @@ -1148,13 +1384,15 @@ salvageJunkPile() { buyAvailableUpgrades() { global - clickPos(xBuy, yBuy) + clickPos(xBuy, yBuy, 2) sleep % zzz * 3 } openNewGilds() { global + showUserSplash("Open new gilds") + clickPos(xNewGild, yNewGild, 100) sleep 3000 clickPos(xOpenGild, yOpenGild) @@ -1165,23 +1403,34 @@ openNewGilds() { raid(doSpend:=0, attempts:=1) { global + exitThread := false + local xBtn := 0, yBtn := 0, raidDuration := 34 * 1000 - local isClickerRunning := getClickerStatus() + local wasClickerRunning := getClickerStatus() + + local mode := doSpend ? "Paid" : "Free" + showUserSplash(mode . " Raid x " . attempts) switchToClanTab() sleep 1000 clickAwayImage(imgClanRaid) - if (!isClickerRunning) { + if (!wasClickerRunning) { clickerStart() sleep 2500 } loop % attempts { + if (exitThread) { + exitThread := false + showUserSplash("Raid aborted!") + break + } if (clickAwayImage(imgClanCollect)) { break } if (doSpend) { + showSplash(mode . " Raid (" . A_Index . "/" . attempts . ")") if (locateImage(imgClanFightAgain, xBtn, yBtn)) { while (!locateImage(imgYes)) { clickPos(xBtn, yBtn, 1, 1) @@ -1197,7 +1446,7 @@ raid(doSpend:=0, attempts:=1) { } } } - if (!isClickerRunning) { + if (!wasClickerRunning) { clickerStop() } } @@ -1241,10 +1490,31 @@ toggleMode(toggle:=1) { global if (toggle) { ControlSend,, {vk41}, ahk_id %chWinId% ; {a}, {vk41} or {sc01E} + ; clickPos(xMode, yMode) sleep % zzz } } +setFarmMode(silent:=0) { + global + if (locateImage(imgProgression)) { + toggleMode() + if (!silent) { + showDebugSplash("Set Farm Mode") + } + } +} + +setProgressionMode(silent:=0) { + global + if (!locateImage(imgProgression)) { + toggleMode() + if (!silent) { + showDebugSplash("Set Progression Mode") + } + } +} + activateSkills(skills) { global reFocus() @@ -1275,7 +1545,7 @@ handleScheduledReload(function := "") { global local params := function != "" ? "/autorun " . function : "" if (scheduleReload) { - showSplashAlways("Reloading bot... " . params, 3) + showUserSplash("Script Reload " . params, 3) Run "%A_AhkPath%" /restart "%A_ScriptFullPath%" %params% } } @@ -1283,7 +1553,7 @@ handleScheduledReload(function := "") { handleScheduledStop() { global if (scheduleStop) { - showSplashAlways("Scheduled stop. Exiting...") + showUserSplash("Scheduled stop. Exiting...") scheduleStop := false exit } @@ -1308,19 +1578,19 @@ hasClickable() { } ; Try to find the first gilded hero/ranger we can lvl up -locateGilded(byref xPos, byref yPos, byref isNew) { +locateGilded(byref xPos, byref yPos, byref isNew, startAt:=0, earlyGameMode:=0) { global isNew := 0 - local xAbs, yAbs, startAt := 0 + local xAbs, yAbs - if (!locateImage(imgBuyUpgrades)) { + if (startAt = 0 and !locateImage(imgBuyUpgrades)) { if (!locateImage(imgCombat)) { switchToCombatTab() } scrollToBottom() } - while (upLocator(imgGilded, "Gilded hero", xAbs, yAbs, 5, 1, 1, startAt)) { + while (upLocator(imgGilded, "Gilded hero", xAbs, yAbs, 2, 5, 1, startAt, earlyGameMode)) { ; two retries local xPixel := xAbs + 83 ; HI[R]E local yPixel := yAbs + 38 if (matchPixelColor(dimmedYellowColor, xPixel, yPixel)) { @@ -1340,7 +1610,10 @@ locateGilded(byref xPos, byref yPos, byref isNew) { solomonLeveler(levels) { global local x, y + if (useImageSearch) { + showSplash("Level Solomon x " . levels) + switchToAncientTab() if (locator(imgSolomon, "Solomon", x, y)) { ; Offset coordinates to the lvl up button @@ -1388,6 +1661,87 @@ checkSafetyZones() { } } +zoneMovedWithin(zone, sec) { + loop % sec * 10 { + sleep 100 + zoneMoved := getCurrentZone() - zone + if (zoneMoved) { + return zoneMoved + } + } + return 0 +} + +farmOrFight() { + global + local silent := true + local bossZone := farmZone + 1 + local maxTime := 1.5 ; s + + setProgressionMode(silent) ; Toggle progress on, then + if (zoneMovedWithin(farmZone, maxTime) > 0) { ; if we reached the boss in time + scrollToZone(farmZone) ; scroll back + local startTime := A_TickCount + if (zoneMovedWithin(farmZone, maxTime) > 0) { ; if fast enough still + showDebugSplash("Lvl " . bossZone . " boss fight!") + local zoneMoved := zoneMovedWithin(bossZone, 30) + local elapsedTime := (A_TickCount - startTime - zzz) // 1000 + if (zoneMoved > 0) { + showDebugSplash("Fight duration: " . elapsedTime . "s") + isFarming := false + lvlUpDelay := 6 ; reset + return + } else { + showDebugSplash("Failed boss... :(") + } + } + } + + if (zoneTicks.HasKey(bossZone)) { + zoneTicks.Delete(bossZone) + } + + ; Keep farming... + if (bossZone >= 110 and secPerMonster >= 5 and locateImage(imgLuckyStrikes)) { + ; If available, use skills on tough bosses + showDebugSplash("Push with skills @ Lvl " . getCurrentZone()) + isFarming := false + if (!getClickerStatus()) { + clickerStart(clickerDuration) + } + setProgressionMode(silent) + activateSkills("2-3") + } else { + setFarmMode(silent) + sleep % zzz + if (farmZone < getCurrentZone()) { + ; Make sure we are farming on the correct lvl + scrollToZone(farmZone) + } + showDebugSplash("Keep farming!") + SetTimer, farmTimer, % -farmTime * 1000, 1 + lvlUpDelay := 18 ; up the chance to lvl up next hero + } +} + +storeZoneTick() { + global + local cz := getCurrentZone() + local pz := cz - 1 + local currentTime := A_TickCount + + if (!zoneTicks.HasKey(pz)) { + zoneTicks[pz] := currentTime + } + if (!zoneTicks.HasKey(cz)) { + zoneTicks[cz] := currentTime + local elapsed := (zoneTicks[cz] - zoneTicks[pz]) / 1000 + if (mod(cz-4, 5) = 0 and elapsed >= 20) { + showDebugSplash("Lvl " . pz . " -> " . cz . " : " . formatSeconds(elapsed)) + } + } +} + ; ----------------------------------------------------------------------------------------- ; -- Subroutines ; ----------------------------------------------------------------------------------------- @@ -1407,3 +1761,15 @@ comboTimer: activateSkills(deepRunCombo[comboIndex]) comboIndex := comboIndex < deepRunCombo.MaxIndex() ? comboIndex+1 : 2 return + +clickerStopTimer: + clickerStop() +return + +farmTimer: + farmOrFight() +return + +zoneTickTimer: + storeZoneTick() +return diff --git a/common_setups.md b/common_setups.md index 89c8c4d..193d86f 100644 --- a/common_setups.md +++ b/common_setups.md @@ -5,14 +5,15 @@ Example settings for different styles of play. ## Overview * [Speed Run](#speed-run) -* [Deep Run](#deep-run) * [Vision Run](#vision-run) +* [Early Game Vision Run](#early-game-vision-run) +* [Deep Run](#deep-run) * [Do not disturb](#do-not-disturb) * [Dual monitors](#dual-monitors) ## Global Settings - optimalLevel := 2000 + gildedRanger := 6 ; Lilin autoAscend := true saveBeforeAscending := true @@ -20,7 +21,6 @@ Example settings for different styles of play. ## Speed Run useImageSearch := false - gildedRanger := 6 ; Lilin #### Idle @@ -46,19 +46,11 @@ Example settings for different styles of play. speedRunStartCombo := comboHybridIdle deepRunCombo := comboHybridActive -## Deep Run - - deepRunTime := 60 * 8 - deepRunClicks := true - - deepRunCombo := comboEDR - ## Vision Run useImageSearch := true - gildedRanger := 6 ; Lilin - clickableHuntDelay := 8 + clickableHuntDelay := 5 stopHuntThreshold := 0 useMidasStart := true @@ -67,7 +59,7 @@ Example settings for different styles of play. #### Idle irisLevel := 1029 - endLvlIdle := optimalLevel + endLvlIdle := 2000 endLvlActive := 0 activateSkillsAtStart := false @@ -76,7 +68,7 @@ Example settings for different styles of play. #### Hybrid irisLevel := 1199 - endLvlIdle := optimalLevel + endLvlIdle := 2000 endLvlActive := 2200 activateSkillsAtStart := true @@ -91,13 +83,73 @@ Example settings for different styles of play. irisLevel := 1669 endLvlIdle := 0 - endLvlActive := irisLevel + 630 + endLvlActive := irisLevel + 1 + 630 activateSkillsAtStart := false deepRunClicks := true deepRunCombo := comboMidas +## Early Game Vision Run + + useImageSearch := true + earlyGameMode := true + + deepRunClicks := true + deepRunCombo := comboEarlyGame + + clickableHuntDelay := 5 + stopHuntThreshold := 0 + + clickerDuration := 30 + +#### Idle + + endLvlIdle := 500 + endLvlActive := 10 ; need this unless Khrysos lvl > 0 + + lastFarmZone := 129 + +#### Active + + endLvlIdle := 0 + endLvlActive := 500 + + lastFarmZone := 139 + +## Deep Run + + deepRunTime := 60 * 8 + deepRunClicks := true + + deepRunCombo := comboEDR + +## Do not disturb + + autoAscendDelay := 0 + displayRelicsDuration := 0 + + screenShotRelics := false + saveBeforeAscending := false + + global playNotificationSounds := false + global playWarningSounds := false + global showProgressBar := false + + showSeverityLevel := 0 ; ch_bot_lib_settings.ahk + +## Dual monitors + +#### Left monitor + + xSplash := A_ScreenWidth // 2 - wSplash // 2 - A_ScreenWidth + xProgressBar := 20 - A_ScreenWidth + +#### Right monitor + + xSplash := A_ScreenWidth // 2 - wSplash // 2 + A_ScreenWidth + xProgressBar := 20 + A_ScreenWidth + ## Skill combos comboEDR := [2.5*60, "2-3-4-5-7-8-6-9", "", "", "", "", "", "8-9-2-3-4-5-7", "2", "2", "2-3-4", "2", "2"] @@ -111,6 +163,8 @@ Example settings for different styles of play. 27:30 : 2 30:00 : repeat +***** + comboHybridIdle := [15*60, "1-2-3-4-5-7-6-9-8"] ; energize > comboHybridActive := [30, "5", "", "", "3", "", "", "8-9-2-5-7", "4", "", "3", "", "1-2"] ; > golden clicks, 6 minutes @@ -122,6 +176,8 @@ Example settings for different styles of play. 04:30 : 3 05:30 : 1-2 +***** + ; ~18 minutes active comboMidas := [30, "9-3-8-6", "2", "", "", "", "", "2", "", "", "", "", "2", "", "", "", "", "2", "", "4", "", "", "2-5", "", "", "", "", "", "3", "", "", "8-9-3-5", "", "", "2-4-7", "", "1", "", ""] @@ -136,28 +192,3 @@ Example settings for different styles of play. 15:00 : 8-9-3-5 16:30 : 2-4-7 17:30 : 1 - -## Do not disturb - - autoAscendDelay := 0 - displayRelicsDuration := 0 - - screenShotRelics := false - saveBeforeAscending := false - - global playNotificationSounds := false - global playWarningSounds := false - global showSplashTexts := false - global showProgressBar := false - -## Dual monitors - -#### Left monitor - - xSplash := A_ScreenWidth // 2 - wSplash // 2 - A_ScreenWidth - xProgressBar := 20 - A_ScreenWidth - -#### Right monitor - - xSplash := A_ScreenWidth // 2 - wSplash // 2 + A_ScreenWidth - xProgressBar := 20 + A_ScreenWidth diff --git a/images/clickable.png b/images/clickable.png index 3313271e298351f3ec129f213d225d8d38c87f5c..da53fee6bf9e40f220570598d9d44bf868385a9f 100644 GIT binary patch delta 63 zcmZo+>|>k|W})oq;ustd delta 53 zcmeBUY+;-brYGs?;us#^thv3VE_V8S3j3^ HP6Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0!>LoK~y+TbyRCl zQ$Y~rKaps{2P83q#t-5v`T=9`0Vpa26qQ#&(;!w*f{-Y_Vxti>0ufClARx~K+EOc& zUa+)ONx9UvMuA@F?Rsu!v%S=~Ica9jOs8jNXPc6jIzIxRK1=sZgH$%u$5n3P39n2`;BkD?dUMgdKGf0ZqY%!EI&Wc`1!Ubx=kuE$N-!M# zicmsIbSp;L_ltR<%4`SRiUSUj1Kc=11M*4rqMjs-bgd#Z@&0EL4~%vP5PDhfP2vg3 zQiA?X_&Df~7#cv;p@fvy(gh4--u9bZ$cn6~YrmpJyKHbP4{FkJplRrh9A4cNrC_L0 zMmEq`;L=a7`tWusTMD0w>C7B4h9g?Wl`K2CW}}A^CO-y=Ny4RcD4I}FS0000a2d+AXFt}b2J-YoHgJ6uTi-4=33+png6-p_Y3QZh`t{UF?{ZoE5SIU6{B`?JV v1jATNc-HZ0^>8`lHA%3!2q=~$Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0T@X{K~y+Tjgvuc z!Y~v>eJ9@oPQ|Ld1}k9MUV?QuNRfO5Rv@t;9cRAB-*#vj4blJp^XvpAVZJ5r7$dHy zGBfrM5U=aTWGF{u<)KUk0iyY zHBMR&=kxbV*gdl?6*auyf@3HrmY0-KrYWuD`zH_cFwNNc^yr4SU3{W^B#gouvBfCh z*Kbj@uvx-L+UlarLltJO<)PgF!AsliCQS!i;rV%0@worM7+J2U=aFEP7>!yyYKt!F hc}mBMr)@07_zQyPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0X9iQK~yMHm6FR& z!ax*;|6V8N0Su?a+uSlmIFkCl*{a%I41O^ir zwc3o53EAwI5E#ki0fu2i=Dna$*g)59s*A-HWt=|}qg;+&E|vZv)$1l@rSeG`M@ZA@ zZ8!{t>T30ael3+cP~Yi1Q=Sl#Ec=*D?sx|@n{T{AxPH&82q6W51k=3X9nfgJQ(Be| z-n77;WU%N2|gFHMhI_n7`X1d~AW(H%00000 LNkvXXu0mjfO--zF literal 0 HcmV?d00001 diff --git a/images/skill_bar.png b/images/skill_bar.png index e0de23cd214f8b04bdc863f1a05fd93e0b7db667..564fca25fb32514c6d682af897c482263fd2d3ce 100644 GIT binary patch delta 104 zcmdnXIE7KMGr-TCmrII^fq{Y7)59eQNV5Pj8wV4R%#L26G*QviPSexHF+?Ifc}2EI z(}J_sYKj)i&+E4p_05~r-&_3PM2?2KohrvE%l#4zyl=IlCbmeG12r>vy85}Sb4q9e E084Wn>;M1& delta 145 zcmbQjxR+6}Gr-TCmrII^fq{Y7)59eQNDBioD+d#h)Y$7FJ5kXzJ;>9=F+?Lcxx=6H z)w~EdEv8pW!O!Rach|Vksm9_ydz=5Aebuk#H5>EE&2Cm>b-7Wh7k_zcS+KmvbGa4g w9xoT4vv0$XM^~R-&s)o+#gO&;^M4M8{;La0X3aKZ0ouag>FVdQ&MBb@0K6A8^8f$< diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 0000000..2211df6 --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/monster_clicker.ahk b/monster_clicker.ahk index de66a8a..546c76a 100644 --- a/monster_clicker.ahk +++ b/monster_clicker.ahk @@ -26,9 +26,10 @@ SetBatchLines, -1 scriptName=Monster Clicker scriptVersion=1.3 -minLibVersion=1.4 +minLibVersion=1.5 script := scriptName . " v" . scriptVersion +tag := "[Clicker] " short := 21 ; ms long := 2000 ; throttled delay @@ -51,10 +52,12 @@ IfNotExist, monster_clicker_settings.ahk #Include *i monster_clicker_settings.ahk if (libVersion < minLibVersion) { - showWarningSplash("The bot lib version must be " . minLibVersion . " or higher!") + showWarningSplash(tag . "The bot lib version must be " . minLibVersion . " or higher!") ExitApp } +logVariable("script", script) + clientCheck() OnMessage(WM_CLICKER_START, "MsgMonitor") @@ -95,7 +98,7 @@ clickerStart() { local monsterClicks := 0 local startTime := A_TickCount - showDebugSplash("Starting...") + showSplash(tag . "Start") if (clickDuration > 0) { setTimer, stopClicking, % -clickDuration * 60 * 1000 ; run only once @@ -112,7 +115,7 @@ clickerStart() { local elapsedTime := (A_TickCount - startTime) / 1000 local clicksPerSecond := round(monsterClicks / elapsedTime, 2) - showSplash("Average CPS: " . clicksPerSecond, 3) + showSplash(tag . "Duration: " . formatSeconds(elapsedTime) . ", CPS: " . clicksPerSecond) } clickerPause() { @@ -134,7 +137,7 @@ clickerStatus() { } clickerReload() { - showSplashAlways("Reloading clicker...", 1) + showUserSplash(tag . "Script Reload", 1) Reload } diff --git a/system/ch_bot_default_settings.ahk b/system/ch_bot_default_settings.ahk index eba9762..391ec8b 100644 --- a/system/ch_bot_default_settings.ahk +++ b/system/ch_bot_default_settings.ahk @@ -5,39 +5,46 @@ irisLevel := 1029 ; try to keep your Iris within 1001 levels of your optimal zone -; -- Speed Run ---------------------------------------------------------------------------- - -; Clicker Heroes Ancients Optimizer @ http://philni.neocities.org/ancientssoul.html -; Use the optimizer to set the time: -speedRunTime := 29 ; minutes - ; Siyalatas regilding chart @ https://redd.it/3frj62 ; 1:Dread Knight, 2:Atlas, 3:Terra, 4:Phthalo, 5:Banana, 6:Lilin, 7:Cadmia, 8:Alabaster, 9:Astraea ; 10:Chiron, 11:Moloch, 12:Bomber Max, 13:Gog, 14:Wepwawet gildedRanger := 6 ; the number of your main guilded ranger -; Speed Run debug info: Shift+Ctrl+F12 > Alt+F3 - -; -- Deep Run ----------------------------------------------------------------------------- - -deepRunTime := 60 ; minutes +; -- Speed Run ---------------------------------------------------------------------------- -deepRunClicks := true ; click the monster during a deep run? +; Clicker Heroes Ancients Optimizer @ http://philni.neocities.org/ancientssoul.html +; Use the optimizer to set the time: +speedRunTime := 29 ; minutes ; -- Vision Run --------------------------------------------------------------------------- useImageSearch := false ; requires browser client in low quality mode ; Test hotkey: Win+F3 - Search & locate tests for all images -; Vision run +; Vision Run endLvlIdle := 2000 endLvlActive := 0 ; idle: set endLvlActive = 0 (set activateSkillsAtStart to false for 100% idle) ; hybrid: set endLvlActive > endLvlIdle ; active: set endLvlIdle = 0 -levelSolomon := false ; feed solomon after ascending? -solomonLevels := 5 +; -- Early Game Vision Run ---------------------------------------------------------------- + +earlyGameMode := false + +kumawakamaruLevel := 0 + +; Farm till clearing this zone, then use skills when getting stuck on a boss, twice, then ascend +lastFarmZone := 129 ; xx4/xx9 + +; When reaching this zone the script will start leveling only gilded heroes +power5Zone := 181 ; pref. Treebeast, Ivan, Brittany, Samurai, Seer + +; -- Deep Run ----------------------------------------------------------------------------- + +deepRunTime := 60 ; minutes + +deepRunClicks := true ; click the monster during a Deep Run? ; ----------------------------------------------------------------------------------------- ; -- Optional Settings @@ -46,14 +53,23 @@ solomonLevels := 5 ; -- Speed Run ---------------------------------------------------------------------------- firstStintAdjustment := 0 ; add or remove time (in seconds) to or from the first hero -firstStintButton := 1 ; 1 or 2 +firstStintButton := 1 ; 1 or 2 (if possible) + +hybridMode := false ; chain a Deep Run when the Speed Run finish + +; -- Vision Run --------------------------------------------------------------------------- -hybridMode := false ; chain a deep run when the speed run finish +forcedMidasStart := false ; use only for active play with custom Midas combo -; -- Speed/Vision run --------------------------------------------------------------------- +levelSolomon := false ; feed solomon after ascending? +solomonLevels := 5 + +; -- Speed/Vision Run --------------------------------------------------------------------- activateSkillsAtStart := true ; usually needed in the late game to get going after ascending +clickerDuration := 90 ; monster clicker duration (in seconds). 0 = endless + autoAscend := false ; Warning! Set to true will both salvage relics and ascend without any user intervention! ; Auto Ascend Warning Mode @@ -63,7 +79,7 @@ autoAscendDelay := 0 ; warning timer (in seconds) before ascending displayRelicsDuration := 10 ; warning timer (in seconds) before salvaging the junk pile ; If you run the Steam client with autoAscend, you can screenshot every relic you salvage! -screenShotRelics := false ; +screenShotRelics := false saveBeforeAscending := false ; autosave the game. @@ -75,10 +91,15 @@ saveButtonClassNN := "Button2" ; Button1 or Button2 ; a "already exists" message, change save mode to 2. saveMode := 1 ; 1 or 2 -; -- Deep/Vision run ---------------------------------------------------------------------- +; -- Deep/Vision Run ---------------------------------------------------------------------- -clickableHuntDelay := 8 ; hunt for a clickable every 8s -stopHuntThreshold := 4 ; stop hunt when this many minutes remain of a run +clickableHuntDelay := 5 ; hunt for a clickable every 5s + +; Stop hunt when this many minutes remain of a run. +; Set to 0 when using the Vision Run, or Speed Run in hybrid mode with Midas starts +stopHuntThreshold := 20 +; Odds of getting a clickable for different thresholds: +; 5 - 59.4%, 10 - 83.5%, 15 - 93.3%, 20 - 97.3%, 25 - 98.9%, 30 - 99.55% ; -- Midas -------------------------------------------------------------------------------- @@ -104,15 +125,14 @@ midasZoneConfig := [56, 6, 0, 0, 76, 0] ; Siya 400: | [47, 5, 57, 4, 67, 4] ; Test hotkeys: -; Win+F1 - One Midas start -; Win+F2 - Loop Midas start + init run + ascend +; Win+F1 - One Midas Start +; Win+F2 - Loop Midas Start + Init Run + ascend ; -- Look & Feel -------------------------------------------------------------------------- ; true or false global playNotificationSounds := false ; global playWarningSounds := true ; -global showSplashTexts := true ; Note that some splash texts will always be shown. global showProgressBar := true ; Splash text window width and position @@ -140,11 +160,14 @@ yProgressBar := 20 ; Test with tools/combo_tester.ahk comboStart := [15*60, "8-1-2-3-4-5-7-6-9"] +comboStart2 := [15*60, "8-5-2-3-4-7-6-9"] ; requires deepRunClicks set to true comboEDR := [2.5*60, "2-3-4-5-7-8-6-9", "", "", "", "", "", "8-9-2-3-4-5-7", "2", "2", "2-3-4", "2", "2"] comboEGolden := [2.5*60, "8-5-2-3-4-7-6-9", "2", "2", "2-3-4", "2", "2"] comboGoldenLuck := [2.5*60, "6-2-3-5-8-9", "2-3-4-5-7", "2", "2", "2-3-4", "2", "2"] +comboEarlyGame := [10*60, "3-7-8-9-4-5-6", "2-3-7", "2", "2", "2-3-4", "2", "2"] + ; Hybrid combo comboHybridIdle := [15*60, "1-2-3-4-5-7-6-9-8"] ; energize > comboHybridActive := [30, "5", "", "", "3", "", "", "8-9-2-5-7", "4", "", "3", "", "1-2"] ; > golden clicks, 6 minutes @@ -152,7 +175,10 @@ comboHybridActive := [30, "5", "", "", "3", "", "", "8-9-2-5-7", "4", "", "3", " ; Midas: 1-4-5 2:30 5:00 7:30 10:00 12:30 15:00 17:30 comboMidas := [30, "9-3-8-6", "2", "", "", "", "", "2", "", "", "", "", "2", "", "", "", "", "2", "", "4", "", "", "2-5", "", "", "", "", "", "3", "", "", "8-9-3-5", "", "", "2-4-7", "", "1", "", ""] -speedRunStartCombo := comboStart +; Midas: 1-4-5 2:30 5:00 7:30 10:00 12:30 15:00 17:30 +comboMidas2 := [30, "9-3-8-6", "2", "", "", "", "", "2", "", "", "", "", "2", "", "", "", "", "2-4", "", "", "", "", "2-5", "", "", "", "", "", "3", "", "", "8-9-2-5-7", "4", "", "3", "", "1-2", "", ""] + +speedRunStartCombo := comboStart2 deepRunCombo := comboGoldenLuck ; ----------------------------------------------------------------------------------------- @@ -162,5 +188,3 @@ reGildCount := 300 reGildRanger := gildedRanger raidAttempts := 5 ; Requires useImageSearch set to true - -global debug := false ; Extra debug splash texts diff --git a/system/ch_bot_lib_default_settings.ahk b/system/ch_bot_lib_default_settings.ahk index bba5fff..04b0963 100644 --- a/system/ch_bot_lib_default_settings.ahk +++ b/system/ch_bot_lib_default_settings.ahk @@ -22,3 +22,11 @@ browserTopMargin := 211 fullScreenOption := false ; Steam borderless fullscreen option ; Note: You need to turn on the "Full Screen" option in Clicker Heroes for this option to work. + +; Severity Levels: 0:OFF, 1:WARN, 2:USER, 3:INFO, 4:DEBUG +showSeverityLevel := 3 ; splash texts +logSeverityLevel := 4 ; file + +; Setting a level to X, will show or log all messages from that level and below. +; E.g. setting showSeverityLevel to 1 and logSeverityLevel to 4, will only show +; warning messages as splash texts, but will log everything to file. diff --git a/system/monster_clicker_default_settings.ahk b/system/monster_clicker_default_settings.ahk index 5364a79..f2bf864 100644 --- a/system/monster_clicker_default_settings.ahk +++ b/system/monster_clicker_default_settings.ahk @@ -9,7 +9,6 @@ clickDuration := 0 ; minutes (set to zero for manual/remote operation) global playNotificationSounds := clickDuration > 0 ? true : false ; no sound when operated remotely global playWarningSounds := false -global showSplashTexts := true ; Splash text window position wSplash := 200 From 3fcd30b7d8873672965bac42eda41780093bf17d Mon Sep 17 00:00:00 2001 From: swiftb Date: Thu, 21 Jan 2016 03:38:56 +0100 Subject: [PATCH 4/7] 0.25 new tab positions --- ch_bot_lib.ahk | 10 +++++----- ch_sw1ft_bot.ahk | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ch_bot_lib.ahk b/ch_bot_lib.ahk index a9902f3..623e1bd 100644 --- a/ch_bot_lib.ahk +++ b/ch_bot_lib.ahk @@ -134,11 +134,11 @@ yAscend := 322 xYes := 500 yYes := 510 ; redesigned ascend window -xCombatTab := 50 -xStatsTab := 212 -xAncientTab := 296 -xRelicTab := 380 + 10 ; Halloween fix -xClanTab := 464 +oTab := 69 ; offset to next tab +xCombatTab := 52 +xAncientTab := xCombatTab + oTab * 3 +xRelicTab := xAncientTab + oTab +xClanTab := xRelicTab + oTab yTab := 130 xRelic := 103 diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index 9ef8772..566d810 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -236,9 +236,11 @@ return scrollToBottom() return -; Ctrl+Alt+F2 should switch to the relics tab and then back +; Ctrl+Alt+F2 should switch between all used tabs ^!F2:: + switchToAncientTab() switchToRelicTab() + switchToClanTab() switchToCombatTab() return From b83a363ccb68c9fc36a1b720f5ded49948f34f84 Mon Sep 17 00:00:00 2001 From: swiftb Date: Fri, 22 Jan 2016 01:04:03 +0100 Subject: [PATCH 5/7] 0.25 image locator fix, doc updates --- FAQ.md | 3 +++ README.md | 7 +++++-- ch_bot_lib.ahk | 10 ++++++---- ch_sw1ft_bot.ahk | 6 +++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/FAQ.md b/FAQ.md index 089e9d8..2c9da9f 100644 --- a/FAQ.md +++ b/FAQ.md @@ -25,6 +25,9 @@ ## Vision Run +**Q:** I get a "Start failed (state = 0)!" warning, what's wrong? +**A:** In Windows, use standard 100% (96 DPI) display scaling in (32 bit) True Color + **Q:** The Vision run gets stuck before reaching my gilded ranger!? **A:** You need one transitional hero/ranger (with 1 gild) that the bot can find after the clickable/Midas start. diff --git a/README.md b/README.md index fb42717..a08a612 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,9 @@ Unless they already exist, three user settings files will be created as copies o ## Configuration +* In Windows: + - Set display scaling to 100% (96 DPI) + - Use True Color (32 bit) * In Clicker Heroes, turn off: - __Show damage texts__ (can cause progression mode issues if left on) - __Show relic found popups__ @@ -216,7 +219,7 @@ The Vision run is usually not that picky about game state, just try start it wit -3 | No Clicker Heroes window found | Open the client -2 | No vision | Set `useImageSearch` to **true** -1 | Vision, but not in browser | Use the browser client - 0 | Vision, but not finding anything | Use standard (100%, 96 DPI) Windows sizes + 0 | Vision, but not finding anything | In Windows, use standard 100% (96 DPI) display scaling in (32 bit) True Color ## Main Hotkeys @@ -262,7 +265,7 @@ These hotkeys can be executed while a speed, deep or vision run is active. | Hotkey | Function | | ------ | -------- | Ctrl+Alt+F1 | Should scroll down to the bottom -Ctrl+Alt+F2 | Should switch to the relics tab and then back +Ctrl+Alt+F2 | Should switch between all used tabs Alt+F1 | Test the `getClickable()` function Alt+F2 | Test the `initRun()` function Alt+F3 | Test the `speedRun()` function diff --git a/ch_bot_lib.ahk b/ch_bot_lib.ahk index 623e1bd..b374690 100644 --- a/ch_bot_lib.ahk +++ b/ch_bot_lib.ahk @@ -136,9 +136,9 @@ yYes := 510 ; redesigned ascend window oTab := 69 ; offset to next tab xCombatTab := 52 -xAncientTab := xCombatTab + oTab * 3 -xRelicTab := xAncientTab + oTab -xClanTab := xRelicTab + oTab +xAncientTab := xCombatTab + oTab*3 +xRelicTab := xCombatTab + oTab*4 + 10 ; Halloween fix +xClanTab := xCombatTab + oTab*5 yTab := 130 xRelic := 103 @@ -663,9 +663,11 @@ locator(image, what, byref xPos, byref yPos, retries:=0, clickCount:=5, absolute local attempts := ceil(45 / clickCount) local attempt := 0 + local keepGoing := true while (!locateImage(image, xPos, yPos, absolute, startAt, directionUp)) { - if (++attempt <= attempts and !locateImage(imgCid)) { + keepGoing := directionUp ? !locateImage(imgCid) : true + if (++attempt <= attempts and keepGoing) { if (directionUp) { scrollUp(clickCount) startAt := 0 ; only offset once diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index 566d810..e17ea19 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -611,10 +611,10 @@ loopVisionRun() { logVariable("deepRunClicks", deepRunClicks, true) if (endLvlActive > 0) { logArray("deepRunCombo", deepRunCombo) - logVariable("clickableHuntDelay", clickableHuntDelay) - logVariable("stopHuntThreshold", stopHuntThreshold) } logVariable("clickerDuration", clickerDuration) + logVariable("clickableHuntDelay", clickableHuntDelay) + logVariable("stopHuntThreshold", stopHuntThreshold) logVariable("saveBeforeAscending", saveBeforeAscending, true) logVariable("autoAscend", autoAscend, true) if (!earlyGameMode) { @@ -1058,7 +1058,7 @@ speedRun() { showSplash("Starting Speed Run") - logVariable("zoneLvl", formatSeconds(zoneLvl)) + logVariable("zoneLvl", zoneLvl) logVariable("firstStintTime", formatSeconds(firstStintTime)) logVariable("lastStintTime", formatSeconds(lastStintTime)) From 34ba388fcca0cde8f608920d1b6c04e2240c81eb Mon Sep 17 00:00:00 2001 From: swiftb Date: Sun, 24 Jan 2016 03:46:37 +0100 Subject: [PATCH 6/7] Added zone data logger option to the Vision Run, changed clickable image --- ch_bot_lib.ahk | 14 +++--- ch_sw1ft_bot.ahk | 67 +++++++++++++++++++++++------ images/clickable.png | Bin 142 -> 133 bytes system/ch_bot_default_settings.ahk | 7 +++ 4 files changed, 71 insertions(+), 17 deletions(-) diff --git a/ch_bot_lib.ahk b/ch_bot_lib.ahk index b374690..f8a9f61 100644 --- a/ch_bot_lib.ahk +++ b/ch_bot_lib.ahk @@ -270,7 +270,7 @@ getClickable(idle:=0) { clientCheck() { global - if (A_TitleMatchMode = 3) { + if (!isBrowserClient()) { calculateSteamAspectRatio() ; Steam } else { local xPos, yPos @@ -517,7 +517,7 @@ logVariable(name, value, isBool:=0) { } ; 0:OFF, 1:WARN, 2:USER, 3:INFO, 4:DEBUG -logger(msg, level) { +logger(msg, level, fileSuffix:="") { global local localTime := A_Now local currentDate @@ -526,7 +526,7 @@ logger(msg, level) { if (severityLevels[level] <= logSeverityLevel) { FormatTime, currentDate, localTime, yyyy-MM-dd FormatTime, currentDateTime, localTime, yyyy-MM-dd HH:mm:ss - fileName := "logs\" . currentDate . ".txt" + fileName := "logs\" . currentDate . fileSuffix . ".txt" FileAppend, % currentDateTime . "`t" . level . "`t" . msg . "`n", %fileName% } } @@ -580,7 +580,7 @@ toggleFlag(flagName, byref flag) { screenShot() { global local activeWinId - if (A_TitleMatchMode = 3) { ; Steam only + if (!isBrowserClient()) { ; Steam only WinGet, activeWinId, ID, A ; remember current active window... WinActivate, ahk_id %chWinId% send {f12 down}{f12 up} ; screenshot @@ -633,7 +633,7 @@ verticalSkills(x) { getCurrentZone() { global local title, currentZone - if (A_TitleMatchMode = "regex") { + if (isBrowserClient()) { WinGetTitle, title, ahk_id %chWinId% currentZone := SubStr(title, 5, InStr(title, "-") - 6) return currentZone @@ -648,6 +648,10 @@ reFocus() { sleep 25 } +isBrowserClient() { + return A_TitleMatchMode = "regex" +} + ; ----------------------------------------------------------------------------------------- ; Note that all image/pixel searches are done with absolute coordinates relative to the ; screen. The CH window is required to be visible and in default size for this to work. diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index e17ea19..74cb3f6 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -893,13 +893,14 @@ visionRun() { } } + updateProgress(zone // barUpdateDelay, endZone - zone, 1) ; show lvls remaining + zone := getCurrentZone() if (zone > maxZone) { maxZone := zone } t += 1 - updateProgress(zone // barUpdateDelay, endZone - zone, 1) ; show lvls remaining sleep 1000 } until zone > endZone @@ -908,8 +909,12 @@ visionRun() { maxLevels() ; get some extra souls from levels } - zoneTicks := "" SetTimer, zoneTickTimer, off + if (useZoneDataLogger) { + logZoneData(zdlStart, endZone, zdlInterval) + } + zoneTicks := "" + SetTimer, comboTimer, off clickerStop() stopProgress() @@ -969,7 +974,7 @@ loopSpeedRun() { local mode := hybridMode ? "Hybrid" : "Speed" showUserSplash("Starting " . mode . " Runs!") - if (A_TitleMatchMode = "regex") { + if (isBrowserClient()) { logVariable("browser", browser) logVariable("browserTopMargin", browserTopMargin) } @@ -1335,6 +1340,7 @@ ascend(autoYes:=false) { } salvageJunkPile() ; must salvage junk relics before ascending + toggleMode() showDebugSplash("Ascend @ Lvl " . getCurrentZone()) @@ -1344,6 +1350,7 @@ ascend(autoYes:=false) { sleep % zzz * 2 stopMonitoring() + sleep 1000 ; wait a sec } salvageJunkPile() { @@ -1729,19 +1736,55 @@ farmOrFight() { storeZoneTick() { global local cz := getCurrentZone() - local pz := cz - 1 - local currentTime := A_TickCount + if (cz > 0) { + local pz := cz - 1 + local currentTime := A_TickCount - if (!zoneTicks.HasKey(pz)) { - zoneTicks[pz] := currentTime + if (!zoneTicks.HasKey(pz)) { + zoneTicks[pz] := currentTime + } + if (!zoneTicks.HasKey(cz)) { + zoneTicks[cz] := currentTime + local elapsed := (zoneTicks[cz] - zoneTicks[pz]) / 1000 + if (mod(cz-4, 5) = 0 and elapsed >= 20) { + showDebugSplash("Lvl " . pz . " -> " . cz . " : " . formatSeconds(elapsed)) + } + } } - if (!zoneTicks.HasKey(cz)) { - zoneTicks[cz] := currentTime - local elapsed := (zoneTicks[cz] - zoneTicks[pz]) / 1000 - if (mod(cz-4, 5) = 0 and elapsed >= 20) { - showDebugSplash("Lvl " . pz . " -> " . cz . " : " . formatSeconds(elapsed)) +} + +logZoneData(zStart, zEnd, zInterval) { + global + local startZone := zStart < zoneTicks.MinIndex() ? zoneTicks.MinIndex() : zStart + local endZone := zEnd > zoneTicks.MaxIndex() ? zoneTicks.MaxIndex() : zEnd + local intervals := ceil((endZone - startZone) / zInterval) + + local zone := startZone + local prevZone := zone - zInterval + + local totalTime := 0 + local intervalTime := 0 + + local t := "`t" ; tab + local nl := "`n" ; new line + local zoneData := "Zones: " . startZone . " -> " . endZone . ", Interval: " . zInterval + zoneData .= nl . "Zone" . t . "Time" . t . "Diff (s)" + zoneData .= nl . zone . t . "00:00:00" . t . "0" + + loop % intervals { + zone += zInterval + if (zone > endZone) { + zone := endZone } + prevZone += zInterval + + totalTime := (zoneTicks[zone] - zoneTicks[startZone]) / 1000 + intervalTime := (zoneTicks[zone] - zoneTicks[prevZone]) / 1000 + + zoneData .= nl . zone . t . formatSeconds(totalTime) . t . round(intervalTime, 1) } + + logger(zoneData, "INFO", "_zone_data") } ; ----------------------------------------------------------------------------------------- diff --git a/images/clickable.png b/images/clickable.png index da53fee6bf9e40f220570598d9d44bf868385a9f..72f36a4fa308443a440b8107680c2d1b05ff6a3e 100644 GIT binary patch delta 89 zcmeBUY-LpJ4DfU3<&xrJU|`_&^l%9R(kwvC#K8n4Kb(4HGEvb~U&_Sa8{q*&?4P|<2y4DfU3<&xrJU|`_&^l%9R(##;t!2~34dMUk_sAy`T?CIhdA`zZkQLXj* x=gK#!ysLQf{Znk$PO=q0d75G2GHXL7hL60wkN(eF=nmAz;OXk;vd$@?2>`NZ9OM81 diff --git a/system/ch_bot_default_settings.ahk b/system/ch_bot_default_settings.ahk index 391ec8b..8b43aa4 100644 --- a/system/ch_bot_default_settings.ahk +++ b/system/ch_bot_default_settings.ahk @@ -64,10 +64,17 @@ forcedMidasStart := false ; use only for active play with custom Midas combo levelSolomon := false ; feed solomon after ascending? solomonLevels := 5 +; Enabled will start to log zone data after each completed run +useZoneDataLogger := false +zdlStart := irisLevel + 1 +zdlInterval := 35 + ; -- Speed/Vision Run --------------------------------------------------------------------- activateSkillsAtStart := true ; usually needed in the late game to get going after ascending +; If you don't need the full skills duration, lower this setting to get back the idle bonus faster. +; E.g. when using the Vision Run in early game mode, this setting should be set to 30. clickerDuration := 90 ; monster clicker duration (in seconds). 0 = endless autoAscend := false ; Warning! Set to true will both salvage relics and ascend without any user intervention! From f9aafd6d3b75bf36ec15d3d5abd4792c572aa083 Mon Sep 17 00:00:00 2001 From: swiftb Date: Sun, 24 Jan 2016 18:01:34 +0100 Subject: [PATCH 7/7] initRun fix for Iris > 3000 --- ch_sw1ft_bot.ahk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ch_sw1ft_bot.ahk b/ch_sw1ft_bot.ahk index 74cb3f6..e4f8544 100644 --- a/ch_sw1ft_bot.ahk +++ b/ch_sw1ft_bot.ahk @@ -357,7 +357,12 @@ initRun(initMode:=0) { reFocus() if (!useImageSearch) { - local clicks := irisLevel > 1600 ? 6 : 7 + local clicks := 7 + if (irisLevel > 3000) { + clicks := 5 + } else if (irisLevel > 1500) { + clicks := 6 + } loop 6 { upgrade(2)