This is the same as https://forum.tribalwars.net/index.php?threads/clear-barbarian-walls.280874/ with small modifications, but I wanted to make sure it's still legal.
The modifications are:
1. The old script runs everything twice (I think the original author might have missed that in the code...