Sau1707 / ModernBot

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

auto farm adds always one town per island #43

Closed Baymax2909 closed 3 months ago

Baymax2909 commented 3 months ago

I edited the auto farm module with the anotiations from PR #39.

The auto farm module now adds one town per islands regardless if the towns are suitable or not. This is achived by adding the rejected towns, that do not fulfill the selection criteria (in example: storage below 80%) to an seperate list. After looping through all towns the list with rejected towns is looped once again to add towns if the island from this town is still missing.

Following the conversation in #39 this should make the bot harder to detect.

Example (Limit = 80%): Town 1, Island A with 85% storage Town 2, Island A with 60% storage Town 3, Island B with 45% storage Town 4, Island C with 90% storage Town 5, Island C with 85% storage

After looping through all towns the list looks like this: polisList = [2, 3], islandList = [A, B], non_suitable_polisList = [1, 4, 5]

Now we loop through the non_suitbale_polisList and after this the list looks like this: polisList = [2, 3, 4], islandList = [A, B, C]

Baymax2909 commented 3 months ago

I made a mistake in the code I just realised. It has not produced any errors during testing but is a mistakt. I will open a new PR once I fixed it.