The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

🧱 5.4.2.5.2 - Better Troops Deployment (LF Style), Fixed Train Troops

Started by safar46 · Jan 25, 2015

546 replies7,799,713 viewsLocked
Feb 1, 2015#291

James wrote:

DrImmo wrote:

safar46 wrote:

New update, check first page

@Safar46
Would be too nice if you can tell us, what changes you did 🙂

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

indy wrote:

nicely done 🙂

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.

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

@James new update, check page one. thanks for your report 🙂
@indy implemented in new update, check page one. thanks for your contribute 🙂

Feb 1, 2015#292

another update! Thanks bro

Feb 1, 2015#293

Amazing update @safar46, my only requested feature is to snipe dark elixer storage with lightening spells. You have made this the be all end all of coc bots.

Feb 1, 2015#294

my bot is working with the past version 5.4.2.2.2 but with this version im stuck in Trying to locate Main Screen. Anyone knows how to fix it?

Feb 1, 2015#295

my bot is working with the past version 5.4.2.2.2 but with this version im stuck in Trying to locate Main Screen. Anyone knows how to fix it?

Troubleshooting can be found in first page

Feb 1, 2015#296

thank you. i feel so stupid lol

EDIT: i tried using the TH sniping but it's buggy. it deploys on the lower right even tho theres no townhall in there. anyone got a good setting for TH sniping?

Feb 1, 2015#297

You working with the other developers to get these features implemented into the "official" update 5.5 when it comes out? I hope so. 🙂

Good work safar46.

Feb 1, 2015#298

Bluestacks: 0.9.1.4057 (disable desktop composition)
win 7 x64 OS
bot version: "COC Bot v5.4.2.4.1 Safar46's Mods+Exe" (run as admin the exe file)
Background Mode: checked
Deploy settings: attack on all sides
                          all troops

Thank you @Safar46 for this quick update.
Background mode is now working for me. wow.  🙌
Currently making this message in a maximized window of my browser and Im just hearing my troops being trained and resources collected. This is great.

But I observed Clan Castle troops do not drop.

Feb 1, 2015#299

Good work, but there is a bug of training troops, sometimes it train other troops like giant, wizard

Feb 1, 2015#300

Bluestacks: 0.9.1.4057 (disable desktop composition)
win 7 x64 OS
bot version: "COC Bot v5.4.2.4.1 Safar46's Mods+Exe" (run as admin the exe file)
Background Mode: checked
Deploy settings: attack on all sides
                          all troops

Thank you @Safar46 for this quick update.
Background mode is now working for me. wow.  🙌
Currently making this message in a maximized window of my browser and Im just hearing my troops being trained and resources collected. This is great.

But I observed Clan Castle troops do not drop.

youre welcome

just see first page, i had update the bot for CC drop fix

This discussion is closed.