Skip to content

Commit

Permalink
1.4.4
Browse files Browse the repository at this point in the history
- Fixed Kiz resets
- Removed Level cap & fast resets
- Level tracking is now optional (turned on when On level reset is
selected). This will speed up idols gain.
- Added Next cycle hotkey to the GUI
- The bot should be less annoying with Storm Rider
  • Loading branch information
Hachifac committed Aug 1, 2017
1 parent ddb82d2 commit 5da8ca3
Showing 8 changed files with 143 additions and 65 deletions.
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
# http://www.reddit.com/r/cotlibot
---
# 1.4.4
---
- Fixed Kiz resets
- Removed Level cap & fast resets
- Level tracking is now optional (turned on when On level reset is selected). This will speed up idols gain.
- Added Next cycle hotkey to the GUI
- The bot should be less annoying with Storm Rider
---
# 1.4.3
---
- Fixed a GUI display issue
Binary file modified images/game/kizReset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/gui/guiAdvancedOptionsHotkeys_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 64 additions & 59 deletions lib/botMain.ahk
Original file line number Diff line number Diff line change
@@ -41,6 +41,8 @@ botLevelCursorCoords[5] := [904, 11, 943, 130]
botLevelCurrentCursor = 0
botLevelPreviousCursor = 0
botCurrentLevel = 0
botTrackCurrentLevel := false
botTempTrackCurrentLevel := false
botSprintModeCheck := false
botCurrentLevelTimeout = 0
botBuffsRarity := ["C", "U", "R", "E"]
@@ -76,7 +78,7 @@ botMaxAllCount = 0
botBuffsSpeedTimer = 0

botSkipToReset := false
optLastoptChatRoom := optChatRoom
optLastChatRoom := optChatRoom

global currentCIndex := [1, 1]
global currentCCoords := [36, 506]
@@ -227,15 +229,15 @@ idolBot:
if (botSession = 0) {
botSession = 1
}
if (optChatRoom > 0 and (optLastoptChatRoom != optChatRoom or botRelaunched = true)) {
if (optChatRoom > 0 and (optLastChatRoom != optChatRoom or botRelaunched = true)) {
botRelaunched := false
Gosub, _BotSetChatRoom
}
MouseMove, 740, 480
Sleep, 100 * optBotClockSpeed
Click

if (optSameLevelTimeout = 1 and botCurrentLevelTimeout > optSameLevelTimeoutDelay) {
if (optSameLevelTimeout = 1 and botCurrentLevelTimeout > optSameLevelTimeoutDelay and botTrackCurrentLevel = true) {
__Log("Same level timeout.")
botPhase = 3
botSkipToReset := true
@@ -266,10 +268,8 @@ idolBot:
} else if (RegExMatch(botCycles[botCurrentCycle].cyclesList[cL], "iO)LevelCrusader\(([\d|\w]+)\)", f)) {
__BotLevelCrusader(f.1)
} else if (RegExMatch(botCycles[botCurrentCycle].cyclesList[cL], "iO)LevelMainDPS", f)) {
if (optResetType = 1 or optResetType = 2 or optResetType = 5 or optResetType = 6) {
if (__UnixTime(A_Now) - botRunLaunchTime > (optMainDPSDelay * 60) and optMainDPS != "None") {
__BotLevelCrusader(optMainDPS)
}
if (__UnixTime(A_Now) - botRunLaunchTime > (optMainDPSDelay * 60) and optMainDPS != "None") {
__BotLevelCrusader(optMainDPS)
}
} else if (RegExMatch(botCycles[botCurrentCycle].cyclesList[cL], "iO)SetFormation\(([\d]+)\)", f)) {
__BotSetFormation(f.1)
@@ -331,39 +331,12 @@ idolBot:
}
}

if (optResetType = 3) {
if (levelCapResetCheck = true) {
__BotMoveToLastPage()
Sleep, 500 * optBotClockSpeed
PixelGetColor, Output, 872, 594, RGB
if (Output = 0x7D2E0C) {
PixelGetColor, Output, 872, 508, RGB
if (Output = 0x979797) {
__Log("Level cap reached.")
botPhase = 3
botSkipToReset := true
}
} else if (Output = 0x979797) {
__Log("Level cap reached.")
botPhase = 3
botSkipToReset := true
}
} else {
__BotMoveToFirstPage()
PixelGetColor, Output, 242, 508, RGB
if (Output = 0x979797) {
__Log("Bush is maxed.")
levelCapResetCheck := true
}
}
}

if (optResetType = 5 and __UnixTime(A_Now) - botRunLaunchTime >= (optRunTime * 60)) {
if (optResetType = 3 and __UnixTime(A_Now) - botRunLaunchTime >= (optRunTime * 60)) {
botSkipToReset := true
botPhase = 3
}

if (optResetType = 6) {
if (optResetType = 4) {
if (botCurrentLevel >= optResetOnLevel) {
__Log("Level " . optResetOnLevel . " reached.")
botSkipToReset := true
@@ -402,18 +375,13 @@ idolBot:
if (ErrorLevel = 0) {
resetPhase = 1
} else {
ImageSearch, resetOutputX, resetOutputY, 657, 631, 869, 665, *150 images/game/kizReset.png
ImageSearch, resetOutputX, resetOutputY, 657, 631, 869, 665, *100 images/game/kizReset.png
if (ErrorLevel = 0) {
resetPhase = 1
} else {
ImageSearch, resetOutputX, resetOutputY, 657, 631, 869, 665, *150 images/game/kizReset2.png
if (ErrorLevel = 0) {
resetPhase = 1
} else {
botDelayReset := true
botSkipToReset := false
Break
}
botDelayReset := true
botSkipToReset := false
Break
}
}
}
@@ -741,15 +709,15 @@ _GUIPos:
Gui, BotGUI: Show, x%nX% y%nY% w575 h35 NoActivate, idolBot
}
if (botPhase > -1) {
if (optResetType = 5) {
if (optResetType = 3) {
timeLeft := Round(((optRunTime * 60) - (__UnixTime(A_Now) - botRunLaunchTime)) / 60)
minutesSTR = minute
if (timeLeft > 1) {
minutesSTR := minutesSTR . "s"
}

}
if (optResetType = 6) {
if (optResetType = 4) {
levelsLeft := optResetOnLevel - botCurrentLevel
GuiControl, BotGUI:, guiMainTimeLeft, Levels left: %levelsLeft%
}
@@ -759,10 +727,10 @@ _GUIPos:
GuiControl, BotGUI:, guiMainStatsIdolsLastReset, % idolsCount
GuiControl, BotGUI:, guiMainStatsIdolsTotal, % statsIdolsThisSession
resetIn = --
if (optResetType = 5) {
if (optResetType = 3) {
resetIn := Round(((optRunTime * 60) - (__UnixTime(A_Now) - botRunLaunchTime)) / 60) . "m"
}
if (optResetType = 6) {
if (optResetType = 4) {
resetIn := optResetOnLevel - botCurrentLevel . " levels"
}
GuiControl, BotGUI:, guiMainStatsResetIn, % resetIn
@@ -781,7 +749,7 @@ _BotPause:
Pause,, 1
if (botPhase = 2 and !A_IsPaused) {
rightKeyInterrupt := true
if (optPromptCurrentLevel = 1 and optResetType = 6) {
if (optPromptCurrentLevel = 1 and optResetType = 4) {
Gosub, _GUICurrentLevel
}
rightKeyInterrupt := false
@@ -870,7 +838,9 @@ SC029::
nX := X + W
nY := Y + H - 677
Gui, BotGUIDev: Show, x%nX% y%nY% w300 h675 NoActivate, idolBot Dev
Gosub, _GUIDevLogging
if (optDevLogging != 1) {
Gosub, _GUIDevLogging
}
} else {
optDevConsole = 0
Gui, BotGUIDev: Hide
@@ -1179,7 +1149,7 @@ __BotSetCampaign(campaign := 0) {
}
Sleep, 2000
}
ImageSearch, OutputX2, OutputY2, 395, 180, 543, 242, *100 images/game/options.png
ImageSearch, OutputX2, OutputY2, 298, 90, 340, 130, *150 images/game/cog.png
if (ErrorLevel = 0) {
__Log("Campaign already started.")
Return
@@ -1500,7 +1470,7 @@ _BotSetChatRoom:
MouseMove, 1135, 18 + (21 * optChatRoom)
Sleep, 100 * optBotClockSpeed
Click
optLastoptChatRoom := optChatRoom
optLastChatRoom := optChatRoom
Return

__BotGetIdolsCount() {
@@ -1532,7 +1502,7 @@ __BotGetIdolsCount() {
}

_BotGetCurrentLevel:
if (botPhase = 2 and botRelaunching = false) {
if (botPhase = 2 and botRelaunching = false and botTrackCurrentLevel = true) {
CoordMode, Pixel, Client
CoordMode, Mouse, Client
rightKeyInterrupt := true
@@ -1617,7 +1587,7 @@ _BotGetCurrentLevel:
Return

_BotBlackWipe:
if ((botPhase = 2) and botRelaunching = false) {
if ((botPhase = 2) and botRelaunching = false and botTrackCurrentLevel = true) {
CoordMode, Pixel, Client
CoordMode, Mouse, Client
if (botLevelCurrentCursor = botLevelPreviousCursor) {
@@ -1821,12 +1791,36 @@ __BotUseSkills:
_BotUseMagnifiedStormRider:
PixelSearch, OutputX, OutputY, 382, 449, 421, 488, 0x0000FE,, Fast
if (ErrorLevel != 0) {
proceed = 0
PixelSearch, OutputX, OutputY, 582, 449, 621, 488, 0x0000FE,, Fast
if (ErrorLevel != 0) {
if (ErrorLevel > 0) {
proceed++
} else {
Return
}
PixelSearch, OutputX, OutputY, 582, 449, 621, 488, 0x7F0000,, Fast
if (ErrorLevel > 0) {
proceed++
} else {
Return
}
PixelSearch, OutputX, OutputY, 582, 449, 621, 488, 0x000000,, Fast
if (ErrorLevel > 0) {
proceed++
} else {
Return
}
PixelSearch, OutputX, OutputY, 582, 449, 621, 488, 0xFC9C10,, Fast
if (ErrorLevel > 0) {
proceed++
} else {
Return
}
if (proceed = 3) {
PixelGetColor, Output, 390, 466, RGB
if (Output != 0x3A3A3A) {
__Log("Disabling progress.")
rightKeyInterrupt = true
rightKeyInterrupt := true
Sleep, 500 * optBotClockSpeed
__Log("Changing to storm rider formation.")
Loop, 5 {
@@ -1850,8 +1844,7 @@ _BotUseMagnifiedStormRider:
}
__Log("Changing back to regular formation and enabling progress.")
__BotSetFormation(optFormation)
Send, {g}
rightKeyInterrupt = false
rightKeyInterrupt := false
}
}
Return
@@ -2047,6 +2040,18 @@ _BotLoadSettings:
if (optStormRiderFormation = 0) {
optStormRiderFormationKey = optFormationKey
}

if (optResetType = 5) {
optResetType = 3
} else if (optResetType = 6) {
optResetType = 4
}

if (optResetType = 4) {
botTrackCurrentLevel := true
botTempTrackCurrentLevel := true
}

StringLower, optMainDPS, optMainDPS
StringLower, optResetCrusader, optResetCrusader
optTempCampaign := optCampaign
9 changes: 9 additions & 0 deletions lib/guiAdvancedOptions.ahk
Original file line number Diff line number Diff line change
@@ -154,6 +154,11 @@ Gui, Add, DropDownList, w100 yp+0 vguiForceResetHotkey1Choice g_GUIChooseForceRe
Gui, Add, Picture, x+23 yp+0 vguiForceResetHotkey2Mask g_GUIForceResetHotkey2Unmask, images/gui/guiAdvancedOptionsHotkeysNone_mask.png
Gui, Add, DropDownList, w100 yp+0 vguiForceResetHotkey2Choice g_GUIChooseForceResetHotkey2 +Hidden

Gui, Add, Picture, x15 y+28 vguiNextCycleHotkey1Mask g_GUINextCycleHotkey1Unmask, images/gui/guiAdvancedOptionsHotkeysDefault_mask.png
Gui, Add, DropDownList, w100 yp+0 vguiNextCycleHotkey1Choice g_GUIChooseNextCycleHotkey1 +Hidden
Gui, Add, Picture, x+23 yp+0 vguiNextCycleHotkey2Mask g_GUINextCycleHotkey2Unmask, images/gui/guiAdvancedOptionsHotkeysNone_mask.png
Gui, Add, DropDownList, w100 yp+0 vguiNextCycleHotkey2Choice g_GUIChooseNextCycleHotkey2 +Hidden

Gui, Tab, 5
Gui, Add, Picture, x0 y0, images/gui/guiAdvancedOptionsBot_bg.png

@@ -217,4 +222,8 @@ if (optExitHotkey1 != "F10" or (optExitHotkey1 = "F10" and optExitHotkey2)) {
if (optForceResetHotkey1 != "F11" or (optForceResetHotkey1 = "F11" and optForceResetHotkey2)) {
Gosub, _GUIForceResetHotkey1Unmask
Gosub, _GUIForceResetHotkey2Unmask
}
if (optNextCycleHotkey1 != "F12" or (optNextCycleHotkey1 = "F12" and optNextCycleHotkey2)) {
Gosub, _GUINextCycleHotkey1Unmask
Gosub, _GUINextCycleHotkey2Unmask
}
Loading

0 comments on commit 5da8ca3

Please sign in to comment.