TWB icon indicating copy to clipboard operation
TWB copied to clipboard

Farm with loses

Open hideth opened this issue 1 year ago • 3 comments

Can you make something that will allow to skip attacking barbs with losses? Either array like for an "additional_farms": [], but doing opposite or skip attacking barb with losses for like 3 days?

hideth avatar Sep 13 '23 14:09 hideth

attack.py

        if cache_entry and not cache_entry["safe"] and not clear:
            self.logger.debug(
                "%s will be ignored for attack because unsafe, set safe:true to override"
                % vid
            )
            return False

manager.py

                       if percentage_lost > 50 and len(num_attack) > 0:
                logger.critical("Farm seems too dangerous/ unprofitable to farm. Setting safe to false!")
                data["safe"] = False
                AttackCache.set_cache(farm, data)

I updated code like this, i hope it will prevent attacking same village if there were any loses. Can you blindly tell if this should work?

hideth avatar Sep 13 '23 19:09 hideth

Hey is it working? Have you tried it ? @hideth

cemalgndzz avatar Sep 25 '23 19:09 cemalgndzz

hey, nope

not sure what to tweak to adjust those farm with loses

hideth avatar Sep 25 '23 21:09 hideth