ClashFarmer Discussion Forum
Troop donations explanation - Printable Version

+- ClashFarmer Discussion Forum (https://www.clashfarmer.com/forum)
+-- Forum: General Discussions (https://www.clashfarmer.com/forum/forumdisplay.php?fid=5)
+--- Forum: General (https://www.clashfarmer.com/forum/forumdisplay.php?fid=8)
+--- Thread: Troop donations explanation (/showthread.php?tid=5919)



Troop donations explanation - gopostal - 08-12-2019

I didn't want to post this in Help and Support because it's not a technical problem, it's more of a "do it this way" thing. Here's my issue:

My wife is way lower level than I am and I want to send her various troops as she needs them. I want her to be able to select barbs, pekkas, or bowlers and I see that she can request those via troop request chat using the bot. The issue I'm having is that if she chats at me with a troop request and it says "bowler" and I don't have enough bowlers the bot locks up and begins a restarting loop. Can someone share the setup they use so that I can prevent my bot from stopping? I'm sure I don't have a setting correct but I've tried different combinations and it always fails to a looping crash.

If I leave the bot at normal settings with barb default it sends her barb troops correctly.

Thanks guys!


RE: Troop donations explanation - Supreme Leader - 08-12-2019

Can you enable debug and add the logs when the bot loops


RE: Troop donations explanation - gopostal - 08-12-2019

Sure but it will be a half day or so before I can post them, it's going to be a long work day. I'll add them tonight to this post. Thanks for looking into this.


RE: Troop donations explanation - Supreme Leader - 08-12-2019

(08-12-2019, 01:43 PM)gopostal Wrote: Sure but it will be a half day or so before I can post them, it's going to be a long work day. I'll add them tonight to this post. Thanks for looking into this.

Thanks no rush post it when ever you can


RE: Troop donations explanation - gopostal - 08-13-2019

OK, I set up debugging and here is the crash....

Environment: I have almost a full army trained up consisting of barbs, archers, and hogs. I was sent a request with the text "bowler" but I do not have any currently in my army. I have enabled "Donate by keyword" and made sure the text "bowler" is assigned to the Bowler.

Opened the chat window
Updating screen...
Screen update took 0.07 (0.23)
Clicking on buttons/chat_clan_tab ([])
Currently on clan chat.
Section [0, 506, 310, 622] ocr: bowler
Donate buttons located: [('bowler', [225, 578])]
Clicking at 228, 577...
Updating screen...
Screen update took 0.07 (0.23)
Updating screen...
Screen update took 0.36 (0.00)
Some Issue Occurred: , <type 'exceptions.AssertionError'>
Traceback (most recent call last):
File "bot.py", line 186, in run
File "maintainer.py", line 515, in train_and_maintain
File "donation.py", line 246, in donate
File "donation.py", line 155, in _donate_to_players
File "donation.py", line 166, in _donate_troops
File "player.py", line 262, in locate
File "player.py", line 230, in load_image
AssertionError

Checking if bot needs a time out.
Professional License: 24 days left
Verifying Emulator and CoC...
Emulator comm established on port 2200
Preparing commands...
Still trying...
Updating screen...
Screen update took 1.08 (0.00)
Making sure the resolution is set correctly...
Updating screen...
Screen update took 1.08 (0.00)
Waiting for CoC to load completely...
Updating screen...
The bot was paused.
Screen update took 0.38 (0.00)
The bot was stopped.

After this the bot ends up in a loop where it keeps trying to restart because the left donation/chat slider stays open and it can't find what it needs to initialize. Let me know if you need anything else, I'm happy to help. Thank you for looking at this.


RE: Troop donations explanation - Supreme Leader - 08-13-2019

Thank you very much for taking the time to post the debug I will forward it to the dev's


RE: Troop donations explanation - gopostal - 08-13-2019

If you are going to talk with them I might also add that there are times when the bot will 'split' and become multiple instances. I've narrowed it down to this:

You are in a battle while the bot is on. Without pausing the bot you end the match and return home. If you then hop over to the builder base and the bot is still alive it will sometimes split and you can see two instances running in the task manager. One is listed as an App and another is listed in the Background Processes (Windows 10). The resulting behavior is that pausing the bot won't always work and even though it's marked as paused it will try to continue on. You need to manually kills the ClashFarmer that's in Background Processes to make things work smoothly again.

I think that may be the root of a lot of the weird behavior you get posted as feedback, especially the stuff that's totally fixed with a restart. I'd guess the exe is split and restarting removes the phantom instance.