The Bytecode Club
5.4.2.5.2 - Better Troops Deployment (LF Style), Fixed Train Troops - Printable Version

+- The Bytecode Club (https://the.bytecode.club)
+-- Forum: Lobby (https://the.bytecode.club/forumdisplay.php?fid=1)
+--- Forum: Game Cheating, Botting & Reverse Engineering (https://the.bytecode.club/forumdisplay.php?fid=97)
+--- Thread: 5.4.2.5.2 - Better Troops Deployment (LF Style), Fixed Train Troops (/showthread.php?tid=441)



5.4.2.4 Safar46's Mods - Fix Deadbase search, Use barracks troops, and more fixed... - DrImmo - 02-02-2015

(02-01-2015, 11:41 PM)using Wrote:  for the last barrack issue, edit the code in the "Func Train()"


Code:
        SetLog("Training Troops Complete")
        Click(1, 1, 2, 250); Click away twice with 250ms delay
        ExitLoop
    WEnd
EndFunc   ;==>Train

(02-01-2015, 11:55 PM)dinobot Wrote:  Regards to the out of sync, try revert to old coding in 5.4.2.2 as below... Swapping of return false and true.
Please test out and report back..


Code:
Func checkNextButton() ;Checks for Out of Sync or Connection Lost errors
    $Message = _PixelSearch(457, 300, 458, 330, Hex(0x33B5E5, 6), 10) ;Check for out of sync or inactivity
    If IsArray($Message) = False Then
        Return False ;Button available
    Else
        Return True ;Out of sync or inactivity error.
    EndIf
EndFunc   ;==>checkNextButton

Thanks in advance guys. I put both changes in the code, testing now... lets see if that's working as well as i think it will Wink


RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - safar46 - 02-02-2015

New update, check first page


RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - schadis - 02-02-2015

will try asap thx for the work


RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - DrImmo - 02-02-2015




RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - James - 02-02-2015




RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - DrImmo - 02-02-2015

(02-02-2015, 01:19 AM)James Wrote:  I think its noted in first page


btw nice update
Been testing it now

edit: 1 error found its not dropping CC troops even though its check in attack settings

Too stupid...
Thx for that advice... i haven't read the text till end...
I saw the changes now ...


RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - indy - 02-02-2015

nicely done Smile

i've got news about the th location on the map.
i've adjusted the _ImageSearchArea function in a way that works most of the times

no background mode, it' only for foreground as i'm unable to get a non black screenshot in background mode.


Code:
Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance)

    if $Tolerance > 0 then $findImage = "*" & $Tolerance & " " & $findImage
    If $ichkBackground = 0 Then
        $x1 += $BSPos[0]
        $y1 += $BSPos[1]
        $right += $BSPos[0]
        $bottom += $BSPos[1]
    EndIf

    If IsString($findImage) Then
      if $tolerance > 0 then
         $findImage = "*" & $tolerance & " " & $findImage
      EndIf
    EndIf

    $result = DllCall("COCBot32.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)

    ; If error exit
    If IsArray($result) Then
        If $result[0] = "0" Then Return 0
    Else
        SetLog("Error cannot check for Dead Base, Attacking...")
        Return 1
    EndIf

    ; Otherwise get the x,y location of the match and the size of the image to
    ; compute the centre of search
   $array = StringSplit($result[0],"|")
   If(UBound($array) >= 4) Then
      $x=Int(Number($array[2]))
      $y=Int(Number($array[3]))
      if $resultPosition=1 then
         $x=$x + Int(Number($array[4])/2) - $x1
         $y=$y + Int(Number($array[5])/2) - $y1
     endif
      return 1
   EndIf
EndFunc



RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - Black Hat - 02-02-2015

We should just call this bot v5.5 due to the amount of Features added to this bot in the past week, and thank you for adding Fast French"s Troop Deploy


RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - safar46 - 02-02-2015

(02-02-2015, 12:27 AM)DrImmo Wrote:  
(02-01-2015, 11:41 PM)using Wrote:  for the last barrack issue, edit the code in the "Func Train()"


Code:
        SetLog("Training Troops Complete")
        Click(1, 1, 2, 250); Click away twice with 250ms delay
        ExitLoop
    WEnd
EndFunc   ;==>Train

(02-01-2015, 11:55 PM)dinobot Wrote:  Regards to the out of sync, try revert to old coding in 5.4.2.2 as below... Swapping of return false and true.
Please test out and report back..


Code:
Func checkNextButton() ;Checks for Out of Sync or Connection Lost errors
    $Message = _PixelSearch(457, 300, 458, 330, Hex(0x33B5E5, 6), 10) ;Check for out of sync or inactivity
    If IsArray($Message) = False Then
        Return False ;Button available
    Else
        Return True ;Out of sync or inactivity error.
    EndIf
EndFunc   ;==>checkNextButton

Thanks in advance guys. I put both changes in the code, testing now... lets see if that's working as well as i think it will Wink

the wrong code in my script only of this
_PixelSearch
(458, 300, 458, 330, Hex
(0x33B5E5, 6), 10)
x left and x right coordinate is same... i change 457 to 458 in new version, and it work like a charm.

for swapping return. im not wrong. this code will not force bot to restarting.
if the Out of Sync message not appear, bot will click in the Next Button location.
But in new version, i was added code when Out of Sync message still not appear and white screen still not gone after 3 minutes, bot will restarting Coc and itself


RE: 5.4.2.4.1 Safar46's Mods - Better Troops Deploy, Fix Out of Sync and 4 Barracks - bushido-21 - 02-02-2015