Open the mIRC script editor by pressing alt + r, go to File > new and paste the little code I gave you.
But in this code you need to change the name of the server you want to connect to


#mircscripting @ irc.swiftirc.net == the best mIRC help channel