Hey EirikSol, I would suggestusing a simple WinAMP plugin. Below is a link to the WinAMP plugins page for mIRC related announcments.

WinAMP PLugIns

I hope this works for you and remember to check back here because someone will post a code for your needs but this is the easiest way for someone that doesn't know coding for mIRC.