In mIRC, go to Tools > Options. Click on Perform. Check off Enable perform on connect. Select AfterNET as the network; you can do this by clicking the Add button and selecting AfterNET from the list. In the Perform commands box, type in /msg authserv auth username password. Click OK twice out of that.