when u are exit, u can't do a /whois beucz the mirc exit immidealty and won't wait for a response from the server.
and for the first thing, u can make an on exit event and on start but there is a problem, when u exit, the mirc first disconnected from all servers so after u'll run the mirc again the /join won't work becuz it won't know which server to connect.