How to batch process raw images - auto tuning levels per image when applying styles

Yes I think the answer to the first part of his question - batch auto tuning filmic levels - would be done via lua script. I’m not terribly familiar with lua though, so can’t give clear advice how to do that.