There were a number of optical and radar directors for the iconic Bofors 40 mm in WWII; here's one example: https://en.wikipedia.org/wiki/Kerrison_Predictor
In terms of planes downed, for the US Navy in WWII this gun beat both the 5/38 with proximity fuzes and the last ditch 20 mm Oerlikon, the latter with a sight right over the barrel(s).