mIRC does support sockets connections... Although I'm not aware of any such scripts in existance (there might be a google search script). Scripting one would require information on the protocols to implement. Another choice would be a DLL that controlled a client that already knows these protocols.
BTW: TeamSpeak's protocol is proprietary, not sure about Ut2004.