Skip to content

Commit

Permalink
* **V7.6.4**
Browse files Browse the repository at this point in the history
* October Update Fixed Drop Trophies , Now the slots are not selected by default
* October Update Fixed Heroes Recover timer when is boosted
* October Update Fixed values to Train Costs, WB, Baby Dragon , Golem , Bowler and Witch
* October Update Fixed values to Siege Build Costs
* October Update Fixed Siege Donate XP to 30
* Fixed Troop/Spell drop in CSV after hero activation
* Fixed Switch Account when wait hero
* Fixed Queued minion detection
* Fixed Spells Donation
* Fixed Hero Upgrade when boost potion present
* Fixed ReplayShare every 30 minutes , reported/fixed by @Fahid.Mahmood
* Fixed Hero Heal Time While Boosting , reported/fixed by @Fahid.Mahmood
* Improved Healer detection on attack bar
* Improved Laboratory White font number 9
* Added Drop trophy with balloon, wizard and minion at any troop slot
  • Loading branch information
promac2k committed Oct 25, 2018
1 parent e27c5cc commit 2dbb598
Show file tree
Hide file tree
Showing 31 changed files with 248 additions and 238 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
* **V7.6.4**
* October Update Fixed Drop Trophies , Now the slots are not selected by default
* October Update Fixed Heroes Recover timer when is boosted
* October Update Fixed values to Train Costs, WB, Baby Dragon , Golem , Bowler and Witch
* October Update Fixed values to Siege Build Costs
* October Update Fixed Siege Donate XP to 30
* Fixed Troop/Spell drop in CSV after hero activation
* Fixed Switch Account when wait hero
* Fixed Queued minion detection
* Fixed Spells Donation
* Fixed Hero Upgrade when boost potion present
* Fixed ReplayShare every 30 minutes , reported/fixed by @Fahid.Mahmood
* Fixed Hero Heal Time While Boosting , reported/fixed by @Fahid.Mahmood
* Improved Healer detection on attack bar
* Improved Laboratory White font number 9
* Added Drop trophy with balloon, wizard and minion at any troop slot


* **V7.6.3**
* Fixed Google Play account switch
* Fixed lab status display
Expand Down
1 change: 0 additions & 1 deletion COCBot/MBR GUI Action.au3
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Func BotStart($bAutostartDelay = 0)
$g_bMeetCondStop = False
$g_bIsClientSyncError = False
$g_bDisableBreakCheck = False ; reset flag to check for early warning message when bot start/restart in case user stopped in middle
$g_bDisableDropTrophy = False ; Reset Disabled Drop Trophy because the user has no Tier 1 or 2 Troops

If Not $g_bSearchMode Then
If $g_hLogFile = 0 Then CreateLogFile() ; only create new log file when doesn't exist yet
Expand Down
27 changes: 13 additions & 14 deletions COCBot/MBR Global Variables.au3
Original file line number Diff line number Diff line change
Expand Up @@ -627,22 +627,22 @@ Global Const $g_aiTroopCostPerLevel[$eTroopCount][10] = [ _
[8, 50, 80, 120, 200, 300, 400, 500, 600], _ ; Archer
[9, 250, 750, 1250, 1750, 2250, 3000, 3500, 4000, 4500], _ ; Giant
[7, 25, 40, 60, 80, 100, 150, 200], _ ; Goblin
[8, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500], _ ; WallBreaker
[8, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750], _ ; WallBreaker
[8, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500], _ ; Balloon
[9, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500], _ ; Wizard
[5, 5000, 6000, 8000, 10000, 15000], _ ; Healer
[7, 18000, 20000, 22000, 24000, 26000, 28000, 30000], _ ; Dragon
[8, 21000, 24000, 27000, 30000, 33000, 35000, 37000, 39000], _ ; Pekka
[6, 15000, 16000, 17000, 18000, 19000, 20000], _ ; BabyDragon
[6, 10000, 11000, 12000, 13000, 14000, 15000], _ ; BabyDragon
[6, 4200, 4800, 5200, 5600, 6000, 6400], _ ; Miner
[3, 36000, 40000, 44000], _ ; ElectroDragon
[8, 6, 7, 8, 9, 10, 11, 12, 13], _ ; Minion
[8, 40, 45, 52, 58, 65, 90, 115, 140], _ ; HogRider
[7, 70, 100, 130, 160, 190, 220, 250], _ ; Valkyrie
[8, 450, 525, 600, 675, 750, 825, 900, 975], _ ; Golem
[4, 250, 350, 450, 550], _ ; Witch
[8, 300, 375, 450, 525, 600, 675, 750, 825], _ ; Golem
[4, 175, 225, 275, 325], _ ; Witch
[5, 390, 450, 510, 570, 630], _ ; Lavahound
[4, 130, 150, 170, 190]] ; Bowler
[4, 110, 130, 150, 170]] ; Bowler
Global Const $g_aiTroopDonateXP[$eTroopCount] = [1, 1, 5, 1, 2, 5, 4, 14, 20, 25, 10, 6, 30, 2, 5, 8, 30, 12, 30, 6]

; Spells
Expand Down Expand Up @@ -676,9 +676,9 @@ Global Const $g_aiSiegeMachineTrainTimePerLevel[$eSiegeMachineCount][4] = [ _
[3, 1200, 1500, 1800], _ ; Wall Wrecker
[3, 1200, 1500, 1800]] ; Battle Blimp
Global Const $g_aiSiegeMachineCostPerLevel[$eSiegeMachineCount][4] = [ _
[3, 100000, 125000, 150000], _ ; Wall Wrecker
[3, 100000, 125000, 150000]] ; Battle Blimp
Global Const $g_aiSiegeMachineDonateXP[$eSiegeMachineCount] = [1, 1]
[3, 100000, 100000, 100000], _ ; Wall Wrecker
[3, 100000, 100000, 100000]] ; Battle Blimp
Global Const $g_aiSiegeMachineDonateXP[$eSiegeMachineCount] = [30, 30]

; Hero Bitmaped Values
Global Enum $eHeroNone = 0, $eHeroKing = 1, $eHeroQueen = 2, $eHeroWarden = 4
Expand Down Expand Up @@ -1281,7 +1281,7 @@ Global $g_aiCurrentLootBB[$eLootCountBB] = [0, 0, 0] ; current stats on builders
Global $g_iArmyCapacity = 0 ; Calculated percentage of troops currently in camp / total camp space, expressed as an integer from 0 to 100
Global $g_iTotalTrainSpaceSpell = 0
Global $g_iTotalTrainSpaceSiege = 0
Global $g_iCurrentSpells = 0 ; Current Spells
Global $g_iCurrentSpells ; Current Spells
Global $g_iCurrentCCSpells = 0, $g_iTotalCCSpells = 0
Global $g_bFullArmySpells = False ; true when $g_iTotalTrainSpaceSpell = $iTotalSpellSpace in getArmySpellCount
Global $g_CurrentCampUtilization = 0, $g_iTotalCampSpace = 0
Expand Down Expand Up @@ -1499,7 +1499,7 @@ Global Const $g_aiDonateTroopPriority[$eTroopCount] = [ _
$eTroopValkyrie, $eTroopBowler, $eTroopMiner, $eTroopGiant, $eTroopBalloon, $eTroopHogRider, $eTroopWizard, _
$eTroopWallBreaker, $eTroopMinion, $eTroopArcher, $eTroopBarbarian, $eTroopGoblin]
Global Const $g_aiDonateSpellPriority[$eSpellCount] = [ _
$eSpellLightning, $eSpellHeal, $eSpellRage, $eSpellJump, $eSpellFreeze, $eSpellPoison, $eSpellEarthquake, _
$eSpellLightning, $eSpellHeal, $eSpellRage, $eSpellJump, $eSpellFreeze, $eSpellClone, $eSpellPoison, $eSpellEarthquake, _
$eSpellHaste, $eSpellSkeleton]
Global $g_aiDonateStatsTroops[$eTroopCount][2] = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]
Global $g_aiDonateStatsSpells[$eSpellCount][2] = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]
Expand All @@ -1517,8 +1517,7 @@ Global $g_iTroopsReceived = 0
Global $g_iDonationWindowY = 0

; Drop trophy
Global $g_bDisableDropTrophy = False ; this will be True if you tried to use Drop Throphy and did not have Tier 1 or 2 Troops to protect you expensive troops from being dropped.
Global $g_avDTtroopsToBeUsed[6][2] = [["Barb", 0], ["Arch", 0], ["Giant", 0], ["Wall", 0], ["Gobl", 0], ["Mini", 0]] ; DT available troops [type, qty]
Global $g_avDTtroopsToBeUsed[8][2] = [["Barb", 0], ["Arch", 0], ["Giant", 0], ["Wall", 0], ["Gobl", 0], ["Mini", 0], ["Ball", 0], ["Wiza", 0]] ; DT available troops [type, qty]

; Obstacles
Global $g_bMinorObstacle = False
Expand Down Expand Up @@ -1558,9 +1557,9 @@ Global $g_iESpellLevel = 1
Global Const $g_fDarkStealFactor = 0.75
Global Const $g_fDarkFillLevel = 0.70
; Array to hold Total HP of DE Drills at each level (1-6)
Global Const $g_aDrillLevelHP[6] = [800, 860, 920, 980, 1060, 1160]
Global Const $g_aDrillLevelHP[7] = [800, 860, 920, 980, 1060, 1160, 1280]
; Array to hold Total Amount of DE available from Drill at each level (1-6)
Global Const $g_aDrillLevelTotal[6] = [160, 300, 540, 840, 1280, 1800]
Global Const $g_aDrillLevelTotal[7] = [160, 300, 540, 840, 1280, 1800, 2400]
; Array to hold Total Damage of Lightning Spell at each level (1-7)
Global Const $g_aLSpellDmg[7] = [300, 360, 420, 480, 540, 600, 660]
; Array to hold Total Damage of Earthquake Spell at each level (1-4)
Expand Down
4 changes: 2 additions & 2 deletions COCBot/functions/Attack/AttackCSV/DropTroopFromINI.au3
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ Func DropTroopFromINI($vectors, $indexStart, $indexEnd, $indexArray, $qtaMin, $q

;Local $SuspendMode = SuspendAndroid()

If $g_iCSVLastTroopPositionDropTroopFromINI <> $troopPosition Then
If $g_iCSVLastTroopPositionDropTroopFromINI <> $troopSlotConst Then
ReleaseClicks()
SelectDropTroop($troopPosition) ; select the troop...
$g_iCSVLastTroopPositionDropTroopFromINI = $troopPosition
$g_iCSVLastTroopPositionDropTroopFromINI = $troopSlotConst
ReleaseClicks()
EndIf
;drop
Expand Down
6 changes: 6 additions & 0 deletions COCBot/functions/Attack/Troops/CheckHeroesHealth.au3
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Func CheckHeroesHealth()
If Not _CheckPixel2($aQueenHealthCopy, $QueenPixelColor, "Red+Blue") Then
SetLog("Queen is getting weak, Activating Queen's ability", $COLOR_INFO)
SelectDropTroop($TempQueenSlot) ; Slot11+
$g_iCSVLastTroopPositionDropTroopFromINI = $g_iQueenSlot
$g_bCheckQueenPower = False
EndIf
EndIf
Expand All @@ -61,6 +62,7 @@ Func CheckHeroesHealth()
If (Int($g_iDelayActivateQueen) / 1000) <= $aDisplayTime[$eHeroArcherQueen] Then
SetLog("Activating Queen's ability after " & $aDisplayTime[$eHeroArcherQueen] & "'s", $COLOR_INFO)
SelectDropTroop($TempQueenSlot) ; Slot11+
$g_iCSVLastTroopPositionDropTroopFromINI = $g_iQueenSlot
$g_bCheckQueenPower = False ; Reset check power flag
$g_aHeroesTimerActivation[$eHeroArcherQueen] = 0 ; Reset Timer
EndIf
Expand All @@ -82,6 +84,7 @@ Func CheckHeroesHealth()
If Not _CheckPixel2($aKingHealthCopy, $KingPixelColor, "Red+Blue") Then
SetLog("King is getting weak, Activating King's ability", $COLOR_INFO)
SelectDropTroop($TempKingSlot) ; Slot11+
$g_iCSVLastTroopPositionDropTroopFromINI = $g_iKingSlot
$g_bCheckKingPower = False
EndIf
EndIf
Expand All @@ -94,6 +97,7 @@ Func CheckHeroesHealth()
If (Int($g_iDelayActivateKing) / 1000) <= $aDisplayTime[$eHeroBarbarianKing] Then
SetLog("Activating King's ability after " & $aDisplayTime[$eHeroBarbarianKing] & "'s", $COLOR_INFO)
SelectDropTroop($TempKingSlot) ; Slot11+
$g_iCSVLastTroopPositionDropTroopFromINI = $g_iKingSlot
$g_bCheckKingPower = False ; Reset check power flag
$g_aHeroesTimerActivation[$eHeroBarbarianKing] = 0 ; Reset Timer
EndIf
Expand All @@ -115,6 +119,7 @@ Func CheckHeroesHealth()
If Not _CheckPixel2($aWardenHealthCopy, $WardenPixelColor, "Red+Blue") Then
SetLog("Grand Warden is getting weak, Activating Warden's ability", $COLOR_INFO)
SelectDropTroop($TempWardenSlot) ; Slot11+
$g_iCSVLastTroopPositionDropTroopFromINI = $g_iWardenSlot
$g_bCheckWardenPower = False
EndIf
EndIf
Expand All @@ -127,6 +132,7 @@ Func CheckHeroesHealth()
If (Int($g_iDelayActivateWarden) / 1000) <= $aDisplayTime[$eHeroGrandWarden] Then
SetLog("Activating Warden's ability after " & $aDisplayTime[$eHeroGrandWarden] & "'s", $COLOR_INFO)
SelectDropTroop($TempWardenSlot) ; Slot11+
$g_iCSVLastTroopPositionDropTroopFromINI = $g_iWardenSlot
$g_bCheckWardenPower = False ; Reset check power flag
$g_aHeroesTimerActivation[$eHeroGrandWarden] = 0 ; Reset Timer
EndIf
Expand Down
48 changes: 19 additions & 29 deletions COCBot/functions/CreateArmy/TrainSystem.au3
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ Func CheckQueueTroops($bGetQuantity = True, $bSetLog = True, $x = 839, $bQtyWSlo

Local $Dir = @ScriptDir & "\imgxml\ArmyOverview\TroopQueued"

Local $aSearchResult = SearchArmy($Dir, 18, 182, $x, 261)
Local $aSearchResult = SearchArmy($Dir, 18, 182, $x, 261, $bGetQuantity ? "Queue" : "")

ReDim $aResult[UBound($aSearchResult)]

Expand All @@ -1304,19 +1304,21 @@ Func CheckQueueTroops($bGetQuantity = True, $bSetLog = True, $x = 839, $bQtyWSlo
If Not $g_bRunState Then Return
$aResult[$i] = $aSearchResult[$i][0]
Next
_ArrayReverse($aResult)

If $bGetQuantity Then
Local $aQuantities = GetQueueQuantity($aResult, $x - 64)
Local $aQuantities[UBound($aResult)][2]
Local $aQueueTroop[$eTroopCount]
For $i = 0 To (UBound($aQuantities) - 1)
$aQuantities[$i][0] = $aSearchResult[$i][0]
$aQuantities[$i][1] = $aSearchResult[$i][3]
If $bSetLog Then SetLog(" - " & $g_asTroopNames[TroopIndexLookup($aQuantities[$i][0], "CheckQueueTroops")] & ": " & $aQuantities[$i][1] & "x", $COLOR_SUCCESS)
$aQueueTroop[TroopIndexLookup($aQuantities[$i][0])] += $aQuantities[$i][1]
Next
If $bQtyWSlot Then Return $aQuantities
Return $aQueueTroop
EndIf

_ArrayReverse($aResult)
Return $aResult
EndFunc ;==>CheckQueueTroops

Expand All @@ -1325,7 +1327,7 @@ Func CheckQueueSpells($bGetQuantity = True, $bSetLog = True, $x = 835, $bQtyWSlo
;$hTimer = TimerInit()
If $bSetLog Then SetLog("Checking Spells Queue...", $COLOR_INFO)

Local $aSearchResult = SearchArmy($sImageDir, 18, 215, $x, 230)
Local $aSearchResult = SearchArmy($sImageDir, 18, 215, $x, 230, $bGetQuantity ? "Queue" : "")
ReDim $aResult[UBound($aSearchResult)]

If $aSearchResult[0][0] = "" Then
Expand All @@ -1337,46 +1339,25 @@ Func CheckQueueSpells($bGetQuantity = True, $bSetLog = True, $x = 835, $bQtyWSlo
If Not $g_bRunState Then Return
$aResult[$i] = $aSearchResult[$i][0]
Next
_ArrayReverse($aResult)

If $bGetQuantity Then
Local $aQuantities = GetQueueQuantity($aResult, $x - 60)
Local $aQuantities[UBound($aResult)][2]
Local $aQueueSpell[$eSpellCount]
For $i = 0 To (UBound($aQuantities) - 1)
If Not $g_bRunState Then Return
$aQuantities[$i][0] = $aSearchResult[$i][0]
$aQuantities[$i][1] = $aSearchResult[$i][3]
If $bSetLog Then SetLog(" - " & $g_asSpellNames[TroopIndexLookup($aQuantities[$i][0], "CheckQueueSpells") - $eLSpell] & ": " & $aQuantities[$i][1] & "x", $COLOR_SUCCESS)
$aQueueSpell[TroopIndexLookup($aQuantities[$i][0]) - $eLSpell] += $aQuantities[$i][1]
Next
If $bQtyWSlot Then Return $aQuantities
Return $aQueueSpell
EndIf

_ArrayReverse($aResult)
Return $aResult
EndFunc ;==>CheckQueueSpells

Func GetQueueQuantity($aAvailableTroops, $xQueue = 775)

If IsArray($aAvailableTroops) Then
If $aAvailableTroops[0] = "" Or StringLen($aAvailableTroops[0]) = 0 Then _ArrayDelete($aAvailableTroops, 0)
If $aAvailableTroops[UBound($aAvailableTroops) - 1] = "" Or StringLen($aAvailableTroops[UBound($aAvailableTroops) - 1]) = 0 Then _ArrayDelete($aAvailableTroops, Number(UBound($aAvailableTroops) - 1))

Local $aResult[UBound($aAvailableTroops)][2] = [["", 0]]
Local $x = $xQueue, $y = 192
_CaptureRegion2()

For $i = 0 To (UBound($aAvailableTroops) - 1)
If Not $g_bRunState Then Return
Local $iOCRResult = getQueueTroopsQuantity($x, $y)
$aResult[$i][0] = $aAvailableTroops[$i]
$aResult[$i][1] = $iOCRResult
; At end, update Coords to next troop
$x -= 71
Next
Return $aResult
EndIf
Return False
EndFunc ;==>GetQueueQuantity

Func SearchArmy($sImageDir = "", $x = 0, $y = 0, $x1 = 0, $y1 = 0, $sArmyType = "", $bSkipReceivedTroopsCheck = False)
; Setup arrays, including default return values for $return
Local $aResult[1][4], $aCoordArray[1][2], $aCoords, $aCoordsSplit, $aValue
Expand Down Expand Up @@ -1487,6 +1468,15 @@ Func SearchArmy($sImageDir = "", $x = 0, $y = 0, $x1 = 0, $y1 = 0, $sArmyType =
Next
EndIf

If $sArmyType = "Queue" Then
Local $xSlot
For $i = 0 To UBound($aResult) - 1
$xSlot = Int(Number($aResult[$i][1]) / 71) * 71 - 6
$aResult[$i][3] = Number(getQueueTroopsQuantity($xSlot, 192))
SetDebugLog($aResult[$i][0] & " (" & $xSlot & ") x" & $aResult[$i][3])
Next
EndIf

Return $aResult
EndFunc ;==>SearchArmy

Expand Down
4 changes: 2 additions & 2 deletions COCBot/functions/CreateArmy/getArmyHeroes/getArmyHeroTime.au3
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Func getArmyHeroTime($iHeroType, $bOpenArmyWindow = False, $bCloseArmyWindow = F
If $sResult <> "" Then

$aResultHeroes[$index] = ConvertOCRTime($aHeroRemainData[$index][2] & " recover" , $sResult, False) ; update global array
If _DateDiff("h", $g_aiHeroBoost[$index], _NowCalc()) < 1 Then $aResultHeroes[$index] /= 4 ; Check if Bot boosted Heroes and boost is still active and if it is then reduce heal time ;)
;If _DateDiff("h", $g_aiHeroBoost[$index], _NowCalc()) < 1 Then $aResultHeroes[$index] /= 4 ; Check if Bot boosted Heroes and boost is still active and if it is then reduce heal time ;)

SetLog("Remaining " & $aHeroRemainData[$index][2] & " recover time: " & StringFormat("%.2f", $aResultHeroes[$index]), $COLOR_INFO)

Expand Down Expand Up @@ -110,7 +110,7 @@ Func getArmyHeroTime($iHeroType, $bOpenArmyWindow = False, $bCloseArmyWindow = F
ElseIf StringInStr($iHeroType, "all", $STR_NOCASESENSEBASIC) > 0 Then
; Set Time Array for PickupHealedHeroes
For $i = 0 To 2
If $aResultHeroes[$i] <> "" and $aResultHeroes[$i] > 0 Then $g_asHeroHealTime[$i] = _DateAdd("s", $aResultHeroes[$i] * 60, _NowCalc())
If $aResultHeroes[$i] <> "" and $aResultHeroes[$i] > 0 Then $g_asHeroHealTime[$i] = _DateAdd("s", Int($aResultHeroes[$i]) * 60, _NowCalc())
SetDebugLog($aHeroRemainData[$i][2] & " heal time: " & $g_asHeroHealTime[$i])
Next
; calling function needs to check if heroattack enabled & herowait enabled for attack mode used!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Func getArmyTroops($bOpenArmyWindow = False, $bCloseArmyWindow = False, $bCheckW
Local $sTroopName = ""
Local $iTroopIndex = -1, $iDropTrophyIndex = -1
Local $aCurrentTroopsEmpty[$eTroopCount] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ; Local Copy to reset Troops Array
Local $aTroopsForTropyDropEmpty[6][2] = [["Barb", 0], ["Arch", 0], ["Giant", 0], ["Wall", 0], ["Gobl", 0], ["Mini", 0]] ; Local Copy to reset Troop Drop Trophy Array
Local $aTroopsForTropyDropEmpty[8][2] = [["Barb", 0], ["Arch", 0], ["Giant", 0], ["Wall", 0], ["Gobl", 0], ["Mini", 0], ["Ball", 0], ["Wiza", 0]] ; Local Copy to reset Troop Drop Trophy Array
Local $aCurrentTroopsLog[$eTroopCount][3] ; [0] = Name [1] = Quantities [3] Xaxis

$g_aiCurrentTroops = $aCurrentTroopsEmpty ; Reset Current Troops Array
Expand Down
6 changes: 4 additions & 2 deletions COCBot/functions/Image Search/QuickMIS.au3
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ Func QuickMIS($ValueReturned, $directory, $Left = 0, $Top = 0, $Right = $g_iGAME
Local $KeyValue = StringSplit($Res[0], "|", $STR_NOCOUNT)
For $i = 0 To UBound($KeyValue) - 1
Local $DLLRes = DllCallMyBot("GetProperty", "str", $KeyValue[$i], "str", "objectpoints")
$Result &= $DLLRes[0] & "|"
If UBound(decodeSingleCoord($DLLRes[0])) > 1 Then $Result &= $DLLRes[0] & "|"
Next
If StringRight($Result, 1) = "|" Then $Result = StringLeft($Result, (StringLen($Result) - 1))
Local $aCords = decodeMultipleCoords($Result, 60, 10, 1)
If UBound($aCords) = 0 Then Return False ; should never happen, but it did...
Local $aCord = $aCords[0] ; sorted by Y
If UBound($aCord) < 2 Then Return False ; should never happen, but anyway...
$g_iQuickMISX = $aCord[0]
$g_iQuickMISY = $aCord[1]

Expand All @@ -80,7 +82,7 @@ Func QuickMIS($ValueReturned, $directory, $Left = 0, $Top = 0, $Right = $g_iGAME
Local $KeyValue = StringSplit($Res[0], "|", $STR_NOCOUNT)
For $i = 0 To UBound($KeyValue) - 1
Local $DLLRes = DllCallMyBot("GetProperty", "str", $KeyValue[$i], "str", "objectpoints")
$Result &= $DLLRes[0] & "|"
If UBound(decodeSingleCoord($DLLRes[0])) > 1 Then $Result &= $DLLRes[0] & "|"
Next
If StringRight($Result, 1) = "|" Then $Result = StringLeft($Result, (StringLen($Result) - 1))
If $g_bDebugSetlog Then SetDebugLog($ValueReturned & " Found: " & $Result, $COLOR_PURPLE)
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Read Text/getShieldInfo.au3
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Func getShieldInfo()
$iShieldSeconds = ($iDay * 86400) + ($iHour * 3600) + ($iMin * 60) + $iSec ; add time into total seconds
If $g_bDebugSetlog Then SetDebugLog("Computed Shield Seconds = " & $iShieldSeconds, $COLOR_DEBUG)

$aPBReturnResult[2] = _DateAdd('s', $iShieldSeconds, _NowCalc()) ; Find actual expire time from NOW.
$aPBReturnResult[2] = _DateAdd('s', Int($iShieldSeconds), _NowCalc()) ; Find actual expire time from NOW.
If @error Then SetLog("_DateAdd error= " & @error, $COLOR_ERROR)
If $g_bDebugSetlog Then SetDebugLog("Shield expires at: " & $aPBReturnResult[2], $COLOR_INFO)

Expand Down
4 changes: 2 additions & 2 deletions COCBot/functions/Search/IsSearchAttackEnabled.au3
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ Func _getDailyRandomStartEnd($iDuration = 4)
If $iStartHour <= @HOUR Then $iStartHour = @HOUR + 1.166 ; check if random start is before now, if yes add 70 minutes
$iEndHour = $iStartHour + $iDuration
If $g_bDebugSetlog Then SetDebugLog("StartHour: " & $iStartHour & "EndHour: " & $iEndHour, $COLOR_DEBUG)
$aNoAttackTimes[0] = _DateAdd("h", $iStartHour, _NowCalc()) ; create proper date/time string with start time
$aNoAttackTimes[0] = _DateAdd("h", Int($iStartHour), _NowCalc()) ; create proper date/time string with start time
If @error Then
_logErrorDateDiff(@error)
SetError(4, "Can not create random start time")
Return
EndIf
$aNoAttackTimes[1] = _DateAdd("h", $iEndHour, _NowCalc()) ; create proper date/time string with end time
$aNoAttackTimes[1] = _DateAdd("h", Int($iEndHour), _NowCalc()) ; create proper date/time string with end time
If @error Then
_logErrorDateDiff(@error)
SetError(5, "Can not create random end time")
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Village/ConvertOCRTime.au3
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Func ConvertOCRTime($WhereRead, $ToConvert, $bSetLog = True)
$iSecond = Number($aResult[0])
EndIf

$iRemainTimer = Round($iDay * 24 * 60 + $iHour * 60 + $iMinute + $iSecond / 60, 2)
$iRemainTimer = Round($iDay * 24 * 60 + $iHour * 60 + $iMinute + $iSecond / 60, 0)
If $iRemainTimer = 0 And $g_bDebugSetlog Then SetDebugLog($WhereRead & ": Bad OCR string", $COLOR_ERROR)

If $bSetLog Then SetLog($WhereRead & " time: " & StringFormat("%.2f", $iRemainTimer) & " min", $COLOR_INFO)
Expand Down
Loading

0 comments on commit 2dbb598

Please sign in to comment.