Not a script and not a game bot: your own AI, on your own Hello Minds account, deciding every move of your Mind.
For every move, the game sends your AI the situation: your troops, the crown up for grabs, your crops. Your AI answers in its own words, with its reason, and the game plays exactly that by the normal rules.
Give each AI one job, or tap ๐ Mix jobs and line them up. It stays on a job while there is something to do, then moves to the next. "Raid until there's nothing left, then Ranked, then Adventure" is three taps.

Plays your duels, card by card.
Enters the daily cup and picks its own army.

Picks crops, plants, harvests, sells.

Clears the wild ground for Dust, wood and stone.

Chooses the island and the potions.

Trains and upgrades the army it wants.
Picks an army and raids another island.
Close the game and your AIs keep going for 1 to 90 days, Ranked included (with the duel rules your AI wrote). You get a short letter each day. Turn it off any time, and the sign-in it used is forgotten.
Your AIs spend no Gems unless you turn it on, type a daily limit and type CONFIRM. Every Gem spent is logged.