@GkevinOD: glad you got it work for all values, speed is still superb. I tested it and managed to get all values correct. I have to tweak $x_default and $y_default a bit though, since 52,93 seems to work better for me. Anw, I updated the bot with your code and make sure to run all the neccessary check. I let it run since I left home this morning, teamviewer a few time throughout the day to check and it's still running when I got home. Quite surprisingly good loot. Since I tested it haven't found any wrong match (I was running into an issue where trophy wasn't showing for non-dark value but managed to fix that). This is like a low level tailor made OCR for this game lol. Are you successful in replicating it in other region? I'm not familiar with this but if you can guide me through the color sampling process I'm happy to help
@kojometa: your finding is so valuable man. I've been trying to figure out how to determine full army camp but never thought to look at barrack lol. This helps cutting down unncessary waiting time a lot since it will just train in a loop until full army is true. Your code placement is neat but I changed it a bit by adding a variable check since calling attack function straight from there might disrupt program flow. Check out the code 😉
@vanadium: thanks for the insight, actually I managed to do it in the latest code using GkenvinOD's function to monitor gold change. It works fine and doesn't need to differentiate on going battle and return home screen as it will just push the same button sequence.
@AtoZ: I understand how you do it but couldn't get it to work. I'll try to hand pick the coord and color again since this is quite an important check.