Causes selected units to be automatically replaced when destroyed.
For example a spotter plane could be given a patrol route and then an auto replace command given (Ctrl-U). If the spotter is destroyed then a build order for a new spotter will be added to the appropriate factory.
When the replacement unit leaves the factory it will be reinstated with its original orders as at the time Ctrl-U was pressed.
Works with multiple units and orders allowing new tactics to be devised such as automatically replaced spy-bots or fighter screens.
I've been using this for playing against the AI for about a year and have been meaning to publish it for a while.
https://gist.github.com/simg/0721002725682bd263f2de2a458e9e5c
