YOu can use the Perform feature
ALT-O -> Connect -> Options -> Click the "Perform" button on the right
Perform...
The perform on connect option allows you to specify a set of commands that you want mIRC to perform when it connects to a specific IRC network. You can specify a set of commands to be performed for All Networks, for a specific network, and for any Other networks that are not specifically assigned their own commands. To understand how commands work, see the Aliases help section.