in onLoop you could do something like:
Position myPosition = new Position(myPlayer().getPosition());
Area myRadius = new Area(new Position(myPosition.getX()+2, myPosition.getY()+2,0), new Position(myPosition.getX()-2, myPosition.getY()-2,0));
the "myRadius" creates a square radius around you. I'm not sure how a mining script works so you have to figure out where you'd want to logically ask if a there are only null rocks in "myRadius"
if(myRadius.contains(NULLROCK.getPosition)){
//all the rocks here are NULL, dropping inventory...
}