Jump to content

[Bug] 2.0: TH Attack - Stuck waiting forever


Recommended Posts

I've verified this bug on 2 different PC (quad core, x86 and x64), using 3 different accounts (TH6, TH9, TH10) with same results. 

I'm using the FAQ recommended settings, and tried hard to make sure it is not a user configuration error before posting, but haven't dug into code to check.

If the bot is configured to TH attack (snipe mode or loot and TH attack doesn't matter), it will eventually get stuck with the log saying:

"~Finished Attacking, waiting to finish"

Eventually CoC times out and gives the " Anyone there?" message.

When I check the attack log it show it dropped 40 archers, some minions if they were available, and lost the trophy on the battle.

Once it took 4 attacks, another time it took 14 attacks.

 

When I come back to find the error, if I reload CoC back to the main screen, after a short delay the bot starts back up with the expected end of battle log messages.

Of course as its doing this it is also clicking the screen in wrong places and brings up the battle history screen, and have to stop bot.

Rather than attached several very long logs, here is the a typical last attack log where the stuck error occurred:


2015-03-21 19:31:32 : ====== Waiting for full army ======
2015-03-21 19:32:06 : Checking Army Camp...
2015-03-21 19:32:08 : Total Army Camp capacity: 220/220
2015-03-21 19:32:08 : Training Troops...
2015-03-21 19:32:10 : Army Camp is Full
2015-03-21 19:33:04 : Going to Attack...
2015-03-21 19:33:10 : ============== Searching For Dead Bases ==============
2015-03-21 19:33:11 : ~~~~~~~~~~~~~~~ SEARCH CONDITIONS ~~~~~~~~~~~~~~~~
2015-03-21 19:33:11 : Meet: Gold or Elixir, TH Outside
2015-03-21 19:33:11 : ~~~~~~~~~~~~~~ RESOURCE CONDITIONS ~~~~~~~~~~~~~~~
2015-03-21 19:33:11 : Aim: [G]:      0 [E]:      0 [D]:    0 [T]:20, Out
2015-03-21 19:33:11 : ~~~~~~~~~~~~~~~ ADVANCED SETTINGS ~~~~~~~~~~~~~~~~
2015-03-21 19:33:11 : THSnipe Combo, 1 Tile(s), AttackTH, Attack2:Extreme
2015-03-21 19:33:11 : ==================================================
2015-03-21 19:33:15 :   1> [G]:  47338 [E]:  88446 [D]:  351 [T]:31 [TH]: 8, In
2015-03-21 19:33:18 :   2> [G]:  16082 [E]:   5193 [D]:   68 [T]:19 [TH]: 7, In
2015-03-21 19:33:23 :   3> [G]:  30496 [E]:  83920 [D]:  323 [T]:32 [TH]: 8, In
2015-03-21 19:33:27 :   4> [G]: 155540 [E]: 118473 [D]:  632 [T]:28 [TH]: 8, In
2015-03-21 19:33:31 :   5> [G]:  72654 [E]:  76294 [D]:  203 [T]:18 [TH]: 9, In
2015-03-21 19:33:35 :   6> [G]:  14124 [E]:  33850 [D]:   45 [T]:14 [TH]: 7, In
2015-03-21 19:33:39 :   7> [G]:  59166 [E]:  29463 [D]:  410 [T]:30 [TH]: 9, In
2015-03-21 19:33:44 :   8> [G]:  50196 [E]: 130055 [D]:  625 [T]:21 [TH]: -, -
2015-03-21 19:33:50 :   9> [G]:  35448 [E]:  11764 [D]:  169 [T]:31 [TH]: -, -
2015-03-21 19:33:54 :  10> [G]:  89588 [E]: 150850 [D]:  693 [T]:16 [TH]: 9, Out
2015-03-21 19:33:56 : ~~~~~ Not a Dead Base, but TH Outside Found! ~~~~~
2015-03-21 19:33:56 : ================ Search Complete =================
2015-03-21 19:33:57 : Preparing to attack
2015-03-21 19:33:57 : -Archers 206
2015-03-21 19:33:58 : -Minions 2
2015-03-21 19:33:58 : -Minions 5
2015-03-21 19:33:58 : -Clan Castle
2015-03-21 19:33:58 : -Queen
2015-03-21 19:34:00 :  ====== Start Attack ======
2015-03-21 19:34:02 : Extreme Attacking TH Outside with BAM PULSE!
2015-03-21 19:34:03 : No  troop Found!!!
2015-03-21 19:34:03 : Dropping first wave of 5 Archers
2015-03-21 19:34:04 : Deployment of Archers Successful!
2015-03-21 19:34:04 : Dropping first wave of 5 Minions
2015-03-21 19:34:05 : Deployment of Minions Successful!
2015-03-21 19:34:16 : No  troop Found!!!
2015-03-21 19:34:16 : No Minions troop Found!!!
2015-03-21 19:34:16 : Dropping second wave of 5 Archers
2015-03-21 19:34:17 : Deployment of Archers Successful!
2015-03-21 19:34:27 : No  troop Found!!!
2015-03-21 19:34:28 : No Minions troop Found!!!
2015-03-21 19:34:28 : Dropping third wave of 5 Archers
2015-03-21 19:34:29 : Deployment of Archers Successful!
2015-03-21 19:34:41 : Extreme Attacking TH Outside in FULL!
2015-03-21 19:34:42 : No  troop Found!!!
2015-03-21 19:34:42 : No  troop Found!!!
2015-03-21 19:34:42 : Dropping first wave of 25 Archers
2015-03-21 19:34:44 : Deployment of Archers Successful!
2015-03-21 19:34:44 : No  troop Found!!!
2015-03-21 19:34:44 : No Minions troop Found!!!
2015-03-21 19:34:44 : No  troop Found!!!
2015-03-21 19:34:45 : No  troop Found!!!
2015-03-21 19:34:45 : No  troop Found!!!
2015-03-21 19:34:48 : Dropping Queen
2015-03-21 19:34:50 : Dropping Clan Castle
2015-03-21 19:34:50 : Waiting 9 seconds before activating King/Queen
2015-03-21 19:34:59 : Activate Queen's power
2015-03-21 19:35:00 : No  troop Found!!!
2015-03-21 19:35:00 : ~Finished Attacking, waiting to finish

After I reload CoC these are next log entries:


2015-03-21 19:49:00 : Checking if the battle has finished
2015-03-21 19:49:02 : Battle has finished
2015-03-21 19:49:02 : Returning Home
2015-03-21 19:49:06 : Taking snapshot of your loot
2015-03-21 19:50:48 : Cannot return home.
2015-03-21 19:50:48 : Trying to locate Main Screen
2015-03-21 19:50:50 : Waiting for Main Screen

I am using custom troops configuration: 45% Barb, 55% Arch, 20 Minion, 4 giants, 4 WB as the FAQ doesn't list recommended troops?

PS - Have noticed another small logic issue, in that the bot is not resetting the troop counts  or barracks after each snipe and eventually fills up mostly archers and couple of minions, if it didn't use all the troops in a full attack.  I haven't investigated the new 2.0 code, but the lack of troops and "troops not found!" log messages may be creating the stuck problem?

Appreciate any help fixing this!

Link to post
Share on other sites

same here. i'm also using TH snipe mode (TH outside checked, TH bully 'un'checked). Attack3-eXtreme!

Script gets stuck  if the TH is 'not destroyed'.  I guess it is waiting for 1 star to exit the war.  No issues when the TH gets destroyed.

Here's some screen-capture.

1. BK not deployed. TH not destroyed yet.

yVNd9FJ.jpg

2. War ended due to time countdown. Bot still waiting...

DlC4BTX.jpg

3. Bot still waiting until log-out. This is when I need to manually restart. After restart, the rest of the script runs..

ksBJLsr.jpg

Link to post
Share on other sites

Sorry guys for delayed response.. I've been away for awhile.

Quick Fix: @ Algorithm_AllTroops.au3

Either Delete this


       While 1
  _CaptureRegion()
  If _ColorCheck(_GetPixelColor(746,498), Hex(0x0E1306, 6), 20)=False Then ExitLoop ;exit if not 'no star'
 _Sleep(1000)
Wend

or Replace with:


For 1 to 30 ;30 seconds
  _CaptureRegion()
  If _ColorCheck(_GetPixelColor(746,498), Hex(0x0E1306, 6), 20)=False Then ExitLoop ;exit if not 'no star'
 _Sleep(1000)
Next

If you delete after the bot finishes deployment and failed attack tH, bot may not be able to return home and will engage to the preset attack algorithm (ex. one to all  sides attack).. Hence, better replace it.

P.S. If there are Teslas around, please use giants and or wiz. Btw, you can easily customize the attack. I will post more about it at the FAQ section..

Link to post
Share on other sites

lol - I installed a timer little differently, but haven't seen a stuck issues in last 24 hours with it:


local $iErrorTime = 90000 ; Set to exit star check loop if no win 90 seconds after troop deployment
Local $iBegin = TimerInit()
 Do
     _CaptureRegion()
     If _ColorCheck(_GetPixelColor(746,498), Hex(0x0E1306, 6), 20)=False Then ExitLoop ;exit if not 'no star'
     _Sleep(5000)
Until TimerDiff($iBegin) >= $iErrorTime

I made it wait 5sec between loops as I didn't want  _CaptureRegion running every second?

Link to post
Share on other sites

lol - I installed a timer little differently' date=' but haven't seen a stuck issues in last 24 hours with it:


local $iErrorTime = 90000 ; Set to exit star check loop if no win 90 seconds after troop deployment
Local $iBegin = TimerInit()
 Do
     _CaptureRegion()
     If _ColorCheck(_GetPixelColor(746,498), Hex(0x0E1306, 6), 20)=False Then ExitLoop ;exit if not 'no star'
     _Sleep(5000)
Until TimerDiff($iBegin) >= $iErrorTime

I made it wait 5sec between loops as I didn't want  _CaptureRegion running every second?

[/quote']

can u please upload the modded file here? i tried replacing it but it gives me error after completing the attack and bot crashes

Link to post
Share on other sites

For those not capable of using the autoit editor; here is a link to download the modified Algorithm_AllTroops.au3 file.

Download and replace the file with same name in your game bot folder:

Clash Game Bot v2.0\COCBot\functions\Attack\Attack Algorithms

If you have used any other mods in the Algorithm_AllTroops.au3 file, this will remove them as its the original v2.0 release file.

If you are unable to download and replace the file, just don't use the TH attack function while you wait for the next release.

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...