CodeSlinger69 / ClAsHbOt

Clash of Clans Farm Bot
88 stars 48 forks source link

July 1, 2015 Update - Master Issue Log #19

Closed CodeSlinger69 closed 9 years ago

CodeSlinger69 commented 9 years ago

Well, the July 1 update is upon us, and as expected, it broke a number of things. This issue thread will track the items that I need to fix.

Please add to this thread if you notice any other breaking changes.

deanhill1971 commented 9 years ago

Yell if you need any coding or testing help. I'm a software engineer at my day job and have written a lot of AutoHotkey scripts. Feel free to email me at deanhill1971@gmail.com.

Thanks for the great tool. It's great to hand off loot grinding to a bot.

Tyson88 commented 9 years ago

Yea having all sorts of issues, with staying online and collection, training of course is messed up. Im sure you can get it going again though. Thanks for the update. Will wait until you find time to fix.

CodeSlinger69 commented 9 years ago

First commit for this release is available for testing https://github.com/CodeSlinger69/ClAsHbOt/commit/117c5e8982c51770f4e085a993b172073eab1043 . It seems to work well, but I have only tested it extensively for barcher. If you want to help, here are the areas I have not yet tested, and could use some help. Also, the changes needed were more extensive than I originally thought would be needed - just look at the commit log! I'm sure there are bugs in there that will need to be squashed in the coming days/weeks.

More to come...

Tyson88 commented 9 years ago

I would love and be willing to donate for a balloon and minion raid strategy. Like 24 balloons and 50 minions. I know you have alot more to work on right now but in the future this would be awesome addition for high level raiding

CodeSlinger69 commented 9 years ago

Tyson, LavaLoonian would be great too. Can you do me a favor and start a new Issue for this? That way we keep new feature requests out of the "Fix the darn July 1 update" thread.

deanhill1971 commented 9 years ago

The latest build isn't able to train troops for me. It opens the Army Overview window but apparently can't find the Barb or Archer images. Below is the end of the log. Also attached is BarracksFrame.bmp (converted to .png for this forum). It is slightly ghosted for some reason. This must be why the images aren't found. Other images (like HomeScanFrame.bmp) look fine/not-ghosted.

7/3/2015 11:35:09 AM OpenArmyManagerWindow() 7/3/2015 11:35:10 AM FillBarracksStrategy0(), initial fill. 7/3/2015 11:35:12 AM FillBarracksWithTroops(), Adding 55 Archer box: -1, -1, -1, -1 7/3/2015 11:35:16 AM FillBarracksWithTroops(), Adding 55 Archer box: -1, -1, -1, -1 7/3/2015 11:35:20 AM FillBarracksWithTroops(), Adding 55 Archer box: -1, -1, -1, -1 7/3/2015 11:35:24 AM FillBarracksWithTroops(), Adding 55 Archer box: -1, -1, -1, -1 7/3/2015 11:35:27 AM FillBarracksWithTroops(), Adding 55 Archer box: -1, -1, -1, -1 7/3/2015 11:35:33 AM FillBarracksWithTroops(), Adding 59 Barbarian box: -1, -1, -1, -1 7/3/2015 11:35:37 AM FillBarracksWithTroops(), Adding 59 Barbarian box: -1, -1, -1, -1 7/3/2015 11:35:37 AM Close clicked

barracksframe

deanhill1971 commented 9 years ago

The first issue I ran into with the new build was getting this error:

OpenArmyManagerWindow failed - timeout opening Army Manager Window

I fixed this by changing my Windows 7 theme to Classic (instead of an Aero them). Even after that I had to tweak the search color to get a match.

But this does make me wonder what theme and color settings are ideal. I checked my monitor settings and I'm using "True Color (32-bit)". CodeSlinger: What Windows 7 theme and color depth are you using?

Tyson88 commented 9 years ago

When using the GiBarch attack, the Initial fill loads up the barracks but when it returns to train troops again it spams out of the army overview and clicks stuff behind it (It thinks it is clicking troops button). Upgraded an entire row of walls haha. Not good.

Keep Online Collect These both are working perfectly for me now but AutoRaid is out of the question. But at least I can stay online and collect my resources while not near PC which is awesome.

Tyson88 commented 9 years ago

7/4/2015 8:33:25 AM Auto Begin: Gold:4585084 Elix:3666718 Dark:30917 Cups:2073 7/4/2015 8:33:26 AM AutoQueueTroops() 7/4/2015 8:33:27 AM OpenArmyManagerWindow() 7/4/2015 8:33:27 AM FillBarracksStrategy1(), initial fill. 7/4/2015 8:33:27 AM Wall Breakers needed: 4 7/4/2015 8:33:27 AM Giants needed: 8 7/4/2015 8:33:28 AM Queueing 2 Giant 7/4/2015 8:33:29 AM Queueing 1 Wall Breaker 7/4/2015 8:33:30 AM FillBarracksWithTroops(), Adding 63 Archer box: 387, 274, 461, 320 7/4/2015 8:33:35 AM Queueing 2 Giant 7/4/2015 8:33:36 AM Queueing 1 Wall Breaker 7/4/2015 8:33:37 AM FillBarracksWithTroops(), Adding 48 Barbarian box: 296, 274, 370, 320 7/4/2015 8:33:42 AM Queueing 2 Giant 7/4/2015 8:33:43 AM Queueing 1 Wall Breaker 7/4/2015 8:33:43 AM FillBarracksWithTroops(), Adding 48 Archer box: 387, 274, 461, 320 7/4/2015 8:33:48 AM Queueing 2 Giant 7/4/2015 8:33:49 AM Queueing 1 Wall Breaker 7/4/2015 8:33:50 AM FillBarracksWithTroops(), Adding 63 Archer box: 387, 274, 461, 320 7/4/2015 8:33:54 AM CloseArmyManagerWindow() 7/4/2015 8:36:12 AM CollectLoot() 7/4/2015 8:36:55 AM AutoQueueTroops() 7/4/2015 8:36:55 AM OpenArmyManagerWindow() 7/4/2015 8:36:56 AM FillBarracksStrategy1(), top up. 7/4/2015 8:36:56 AM Wall Breakers needed: 4 7/4/2015 8:36:56 AM Giants needed: 8 7/4/2015 8:36:57 AM FillBarracksWithTroops(), Adding 5 Archer box: -1, -1, -1, -1

This I believe is the major problem, not sure why ^. At this point it clicks out and clicks my walls etc. Advice?

7/4/2015 8:37:03 AM CloseArmyManagerWindow()

chrishubert commented 9 years ago

​Same for me, the mouse pointer goes to the top left corner of the BS window and clicks there.​

7/4/2015 11:56:54 PM Keep Online clicked
7/4/2015 11:56:55 PM Auto Raid clicked
7/4/2015 11:56:59 PM Auto Begin:  Gold:175718 Elix:245548 Dark:49833 Cups:1397
7/4/2015 11:57:00 PM AutoQueueTroops()
7/4/2015 11:57:00 PM OpenArmyManagerWindow()
7/4/2015 11:57:01 PM FillBarracksStrategy0(), initial fill.
7/4/2015 11:57:05 PM FillBarracksWithTroops(), Adding 6 Barbarian box: -1, -1, -1, -1
7/4/2015 11:57:08 PM FillBarracksWithTroops(), Adding 6 Barbarian box: -1, -1, -1, -1
7/4/2015 11:57:11 PM FillBarracksWithTroops(), Adding 6 Barbarian box: -1, -1, -1, -1
7/4/2015 11:57:13 PM FillBarracksWithTroops(), Adding 6 Barbarian box: -1, -1, -1, -1
7/4/2015 11:57:14 PM Auto Raid clicked
7/4/2015 11:57:14 PM Auto Profit:  Gold:0 Elix:0 Dark:0 Cups:0
7/4/2015 11:57:15 PM Keep Online clicked
7/4/2015 11:57:18 PM FillBarracksWithTroops(), Adding 19 Archer box: -1, -1, -1, -1
7/4/2015 11:57:23 PM FillBarracksWithTroops(), Adding 11 Barbarian box: 298, 274, 372, 320
7/4/2015 11:57:26 PM CloseArmyManagerWindow()

I have a barrack under construction - but this it seems to be handling it quite well.

Tyson88 commented 9 years ago

Trained my army myself, and let it do initial fill. It also cannot tell that the army camps are full. AutoQuene is not detecting the red color you added. Probably for same reasons its not finding the troops.

CodeSlinger69 commented 9 years ago

Sorry - was away for the holiday weekend.

I've noticed that when running BlueStacks in a VM, that I see some of the same errors as above.

deanhill1971, Tyson88, I believe both of the "ghosted window" and "not detecting red color" are due to some additional "fade in" animations that SC has added in this release. The solution is simply to delay a bit before doing the color/image detection. I've verified the red color problem, and committed a fix (https://github.com/CodeSlinger69/ClAsHbOt/commit/6ab5b10a3405a8bf8c82be119c4e2682cd3d35ff). The ghost problem I believe is also fixed with the same code change, but I can't test. If you can check it out and report back, I'd appreciate it, Dean.

If you look at the commit log, I simply increased a Sleep call by a bit. Might need a bit of experimenting to find the right value here. Running BlueStacks in a VM exacerbates the fade in problem and makes it easier to see what is going on.

I'll look at the rest of your great feedback tomorrow. However, as far as GiBarch is concerned, Tyson, I can tell you that I have used plain barch exclusively since creating this bot. It's worked well, and continues to work well at TH10 with the Ignore Storages option checked. Might want to try that for farming, while I work on fixing the issues.

Tyson88 commented 9 years ago

Sure thing will do, I will test ASAP and get back with you.

What exactly does ignore storages do? I understand Dead Base Only will only attack dead bases. But what does ignoring the storages do to the attack style?

UPDATE: Troops now training properly, it is filling each barracks with the proper troops, will report back if attack and all goes well.

UPDATE#2: Attack went very well, all troops were deployed on correct side, BK and AQ abilities were activated at perfect time. After my units have died, it sits there for the remaining 45 seconds. Does it not have a check to return home if no loot is recieved within "x" amount of time or something like this.

Doing second attack now.

UPDATE#3: End battle is working I just didn't understand how you had it setup, it doesn't start the timer until after the ability of heroes is activated. Second raid was without heroes and 7/6/2015 2:31:19 AM WaitForBattleEnd() 7/6/2015 2:32:20 AM No change in available loot for 30 seconds, ending battle.

So it is working.

CodeSlinger69 commented 9 years ago

Tyson: I do check for change in available loot to try to detect if all troops have been killed. However, if heroes are deployed, this behavior is overridden, and in fact the bot will wait for the full three minutes. The reason is that I've seen heroes work through an entire base, eventually getting all the loot. I don't want to cut them off too quickly.

Good to hear that things are working better now.

Ignore Storages: from here: https://github.com/CodeSlinger69/ClAsHbOt/wiki/Walkthrough

"This option calculates an estimate of loot in storages based on the math on this web page: http://clashofclans.wikia.com/wiki/Raids. It then figures the amount that is likely in collectors, and only allows bases to be raided if the amount in collectors exceeds the limits set in the match filters section."

I created this to be able to barch at TH10...barching was impossible at TH10 without this logic. Feel free to ignore it prior to TH10, unless you want to play around with it.

Tyson88 commented 9 years ago

Nice I fully understand what you mean by Ignoring the storages now. Also could you point me in the direction of changing the WaitForBattleEnd() because on several of my accounts the heroes are very weak (other than my th10 account) and it makes it look very strange to sit there for 1 minute without doing anything.

Will be testing out the AutoSnipe feature today as well.

Thanks

CodeSlinger69 commented 9 years ago

Tyson, the function signature looks like this: `Func WaitForBattleEnd(Const $kingDeployed, Const $queenDeployed)

If both of the kingDeployed and $queenDeployed parameters are False, then the bot will not wait for the full three minutes. So you need to change the code that calls this function, which exists in AutoRaidStrategy0.au3, AutoRaidStrategy1.au3 and AutoRaidStrategy2.au3.

Change the call in those files to look like this: `WaitForBattleEnd(False, False)

Alternatively, this would be better served as a parameter that can be set in the ini file. If you make me a new Issue to track this new feature request, it will remind me to get it done.

CodeSlinger69 commented 9 years ago

Closing this thread, as I have finished testing almost everything at this time, and we seem to be good to go for the July 1 client release. Please open a new issue if you discover any problems.

Release: https://github.com/CodeSlinger69/ClAsHbOt/releases/tag/20150707