The Bytecode Club

Full Version: [BUG] Attacks end prematurely
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed a couple times that my troops were still attacking, and the bot would end the battle with ~30sec left, even though there was loot still available. I think the troops were working on a storage, but there were a couple collectors left as well.

Code:
While TimerDiff($iBegin) < 30000
Is this time left in the match, or does it check every 30 sec? If the first, I may just change it to 0.
I have also noticed this with version 5.4.2.2
I believe I figured it out. Once one of the resources is depleted, it will end the attack. So you could, in theory, have 0 gold left & 200k elixir left, and it would end Wink

~ line 894
Code:
If $Gold1 = $Gold2 Or $Elixir1 = $Elixir2 Or $Gold2 = "" Or $Elixir2 = "" Then

I'm going to change this to:
Code:
If $Gold1 = $Gold2 Or $Elixir1 = $Elixir2 Or ($Gold2 = "" And $Elixir2 = "") Then

This should fix the issue, assuming parentheses are used the same as other languages.
barracode did upur edit worked? of so can show what you editred?
Yes it worked. You have to edit "COC Bot v5.4.2.2.au3" ... see previous post for location.
Will look into this.