Use the built-in Perform of mIRC.

Do ALT-O -> Connect -> Options -> Perform -> Click Enable perform on Connect -> Select/add the networks -> Paste your code on the space provided then Click OK when done.