the thing with ewar is a little tricky…
Normally you ( like a humain) do that:
take the frigs,but if these are too far, you take whatever is closer
If you have one lost potential ewar ship, you unlock ( if you are full) and lock the ewar ship.
Again, the distance could play a role…
i worked a little over these things, but is alot of code.
also, the distance fuck up the things.
The only way around all this , in my opinion is;
if you do forsaken, then you put your drones on passive and erase the line with distance. . Also, you move the line with prioriyindex to last position. It seems illogical, but actually in the stock pile of datas, the last ones is on the surface ( i cannot explain better) so, ewar it take priority.
The second thing is you will take first the frigates, or actually the ewar ship ( because of waves) and the distance will not interfere. So, everything will rest in the timing for locking the rats. You can increase your signature analysys but also you can change another line; the one with number of maximum targets.
You modify that accordingly with your time for locking targets. I modify that at 2 and the bot stops exactly after i have 4 targets ( the number of frigates /ewar)
If you do haven or other anomaly, put your drones in agressive mode. it will fuck up a litle your cycles, but if you take a dampering sensors from 4 ships, your distance for targeting will decrease at 15-20 km,
The other work around is to make a new … something ( dunno what) with the ewar icons in overview and put a condition like:
if shipui is jammed compare the target selected with the overview rows with ewar right icon . If the target selected has right icon, then shoot, else unlock ( i tried like that but actually didnt work so i found the trick with distance)