Not bad code, at least you're using $str, $r, and $+ rather than a whole block of if's and variables.
I would change alias F1 to something else because that is a default hotkey to open up the mIRC Help File.