Personally, I use mIRC's perform feature. It works as an on connect feature. When you connect to the server, it performs your input. To access it, do the following:
Navigate to 'Tools' in your menu bar, from there select options. If you like shortcuts (which I do), just use Alt O
From there, click the plus next to 'Connect.' This will expand to a sub-menu
After that, select Options which is the second choice in the sub-menu
Within the Options selection, you'll see a button titled 'Perform..' Click that.
Check the box that says 'Enable perform on connect'
In the text area labeled 'Perform commands,' enter in the commands you want to perform.
I like to make sure my nickname is ghosted if I'm ever disconnect it so I can easily recover it. My perform looks like this:
/timer 1 1 ns ghost my_nick my_password
/timer 1 3 nick my_nick
/timer 1 5 ns identify my_password
Pretty easy, basic stuff, but not a lot of people know about that feature. You can do any number of things when you connect.