Would anyone please comment on the message loop problem I mentioned in my commented out code (in the window() function)? I'm still not sure how I'm supposed to create a message loop AND return something to mIRC.