Basically, we'll need more information about your 'automation script' in order to effectively help you. It's currently a case of "not enough information to compute".
_________________________
There are two types of vessels, submarines and targets.