This script needs to be run on the map screen:
/game.php?screen=map
If you are not already there, the script will redirect you there.
This is how the script looks like in practice:
Personally I love to have a frontline group and sometimes it gets hard to manage what village goes into that...