Also, it sounds like you just want Python in mIRC. That exists as a dll, ironically enough. It's called Python4mIRC.