Ok I figured out a few things to make this work better, in your overview set it to list the items by distance. Then find use the closest roid to maco. It should get you within 1k-2k every time.
Now, the only problem I have is that after it does 1 cycle it doesn't close the ship's cargo. So the next time it tries to drag it to the hanger, it closes it then from the macro, leaving all the ore in your hull.
To fix that all you'd have to do is tell it to maco the Ctrl + H right after dropping the ore into your hanger.
Edit: Yep after just a bit of tweaking, this works like a charm. I mined all night.
