Explorers now scan for enemies in range and as soon as one tries to attack, the explorers flee into a gate away from the enemy if possible.
...When there are lots of enemies in the sector there are still chances to have the explorer killed. But they DO avoid at least single threats pretty well now.
All in all I think this is an improvement and as good as possible with the game - so I'm happy with it

Well, I was watching in sector while my kestrel was doing its best to avoid two pirates in Rye's Desire. It was doing well right up until it plowed into an asteroid

The next kestrel in sent in a bit later didn't live much longer. It seems the planet killed it while it was trying to place satellites over the eastern gate. Any why of setting the distance off axis for satellite placement?
Other than this minor self killing issue. I rather like your explorer script.
Playing AP by the way.
Cheers