Way to often I had my drones attacking a General or Malakim battleships (700m size), while smaller cruisers like Crushers (300m size) poked holes in my shield. No more!
I have drafted an algorithm for killing pirates when mining or ratting:
https://drive.google.com/file/d/0B8Wpb_08eBUWU055WFVqSHpURVU/view
Each block is a seprate function, I am now gradually writing them up and will post it some time next week.
This will be an abstract set of functions, meant to be included into a more comprehensive Mining or Ratting script.
Meanwhile I would like to get some feedback and see if you can suggest any idea or conditions I might have overlooked.
P.S. The original diagram from Google Drive to make a copy if you want (needs Draw IO app to work with it):
https://drive.google.com/file/d/0B8Wpb_08eBUWYmU3RW94SXJXcVU/view