Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reduce time of returning back to village
#1
Hi. how can i reduce the time of returning back to village when my troops are all dead?
Reply
#2
are you boosting barracks? if not, you dont need to.
Reply
#3
(02-19-2015, 02:41 PM)btabangay Wrote:  Hi. how can i reduce the time of returning back to village when my troops are all dead?

maybe u got lighting spell ? hehe
Reply
#4
Find this under COCBot/functions/Attack/GoldElixirChange.au3. The default is 60 seconds, change this to whatever you want "While TimerDiff($iBegin) < 60000"

$Gold1 = getGold(51, 66)
$Elixir1 = getElixir(51, 66 + 29)
Local $iBegin = TimerInit()
- While TimerDiff($iBegin) < 60000
If _Sleep(2000) Then Return
WEnd
$Gold2 = getGold(51, 66)
Reply
#5
add this:
Code:
While TimerDiff($iBegin) < 60000
If _Sleep(2000) Then Return
  _CaptureRegion();~~
If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Or _ColorCheck(_GetPixelColor(426,562), Hex(0x60AC10, 6), 20)  Then ExitLoop(2) ;~~ If return button found or mainscreen,exitloop
WEnd
and use this return home:

Code:
Func ReturnHome($TakeSS = 1, $GoldChangeCheck = True) ;Return main screen
        If $GoldChangeCheck = True Then
            If $checkKPower Or $checkQPower Then
               For $i=0 to 9
                  If _Sleep(50000/10 - $delayActivateKQ/10) Then Return
                    _CaptureRegion();~~
                     If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Or _ColorCheck(_GetPixelColor(426,562), Hex(0x60AC10, 6), 20)  Then ExitLoop ;~~ If return button found or mainscreen,proceed
                Next
            Else
                  For $i=0 to 9
                     _Sleep(5000)
                    _CaptureRegion();~~
                     If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Or _ColorCheck(_GetPixelColor(426,562), Hex(0x60AC10, 6), 20)  Then ExitLoop ;~~ If return button found or mainscreen,proceed
;                If _Sleep(50000) Then Return
                  Next
            EndIf
            While GoldElixirChange()
                If _Sleep(1000) Then Return
               _CaptureRegion();~~
                If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Or _ColorCheck(_GetPixelColor(426,562), Hex(0x60AC10, 6), 20)  Then ExitLoop ;~~ If return button found or mainscreen,proceed
            WEnd
        EndIf

        $checkKPower = False
        $checkQPower = False
        SetLog("Returning Home", $COLOR_BLUE)

        If $RunState = False Then Return
         _CaptureRegion();~~
         If  _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20)=False Then  ;if not main screen then go click
            Click(62, 519) ;Click Surrender
            If _Sleep(500) Then Return
            Click(512, 394) ;Click Confirm
            If _Sleep(2000) Then Return
         EndIf                                ;if not main screen then go click
        If $TakeSS = 1 Then
            SetLog("Taking snapshot of your loot", $COLOR_ORANGE)
            Local $Date = @MDAY & "." & @MON & "." & @YEAR
            Local $Time = @HOUR & "." & @MIN
            _CaptureRegion()
            _GDIPlus_ImageSaveToFile($hBitmap, $dirLoots & $Date & " at " & $Time & ".jpg")
        EndIf

        If _Sleep(2000) Then Return
        Click(428, 544) ;Click Return Home Button

        Local $counter = 0
        While 1
            If _Sleep(2000) Then Return
            _CaptureRegion()
            If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Then
                _GUICtrlEdit_SetText($txtLog, "")
                Return
            EndIf

            $counter += 1

            If $counter >= 50 Then
                SetLog("Cannot return home.", $COLOR_RED)
                checkMainScreen()
                Return
            EndIf
        WEnd
EndFunc   ;==>ReturnHome
Reply
#6
thanks a lot sir. im boosting my barracks sir.but yes i have spells

edit..Thanks sir atoz.already found it..
Reply
 


Forum Jump:


Users browsing this thread: 2 Guest(s)

About The Bytecode Club

We're a community focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website