Sau1707 / ModernBot

A Bot for Grepolis
https://sau1707.github.io/ModernBot/
MIT License
22 stars 14 forks source link

Hide troops when attack is incoming #37

Open Baymax2909 opened 4 months ago

Baymax2909 commented 4 months ago

Hide troops automatically when an attack is incoming.

When I would code a little bit better in JS I would do it by myself...

Sau1707 commented 4 months ago

Hello... currently I stopped working on this since I don't play anymore...maybe in the future I'll add more things

Sau1707 commented 4 months ago

How were you thinking this might be implemented?

Baymax2909 commented 4 months ago

Basically send the troops out when an attack is incoming and cancel the command after some time. The result will be, that the troops are not in town during the attack. I will come with some advanced ideas over the weekend. I also will do 1 or 2 PR with some changes I did by myself and I already have tested the last few weeks :)

Sau1707 commented 4 months ago

This will be a complete new module, so before starting it might make sense to think about that is the goal:

Baymax2909 commented 3 months ago

So I found some time to get into detail on this topic. I have to say, that I personally only look at the perspectiv of an conquest player myself. I think on conqest the goal is to not fight with troops if there is no conquest-attack.

In my mind this module could iterate each town on an intervall X and add the town to an data storage if there is at least one attack. Then a second job iterates over this data storage and perform some actions to make sure, that the troops are not hit by the enemy attack. Some of my thoughts:

Sau1707 commented 3 months ago

I thought about this and I don't really like it, here is why:

Currently the bot automatize what is boring and provide help to keep the account more organized and more efficient. I created the bot for this reason, remove the hassle of this boring stuff so that people can focus on the best aspects of the game.

This feature doesn't really match with that, It's part of the game that when you receive an attack there is a chance that you cannot join and therefore your troops can be smashed. This is what I like.

By adding this functionality, that part is lost, this might benefit you but also will damage you when the opponent uses it.

I'm more willing to add something that allow to plan tasks and they get executed at the right time. For example you receive an attack, you look the kind of attack and then schedule to remove the troop at time X, then the bot perform the action. This could be uses for defending as well.