mIRC Homepage

trying to determine if a nickname is registered

Posted By: Richard_B

trying to determine if a nickname is registered - 21/11/10 05:53 PM

a few minutes of searching the archives didn't reveal any simple and elegant way to determine if a user has registered their nickname with NickServ. I'd like to be able to check if a nick is registered to avoid having ChanServ reject an attempt to add the nick to the auto-operators list.

The NickServ used by my target network typically responds to an INFO request for a registered nickname with the following notice:

Time registered: Jun 13 06:33:39 2005 PDT

while an unregistered nickname gets the following notice:

Nick <nickname> isn't registered.


So, obviously one could send NickServ the INFO message for the target nickname, then parse the responses looking for the keywords "Time registered" and "isn't registered" but I'm hoping for a more elegant method.

Any suggestions?

thanks,

Richard
Posted By: DJ_Sol

Re: trying to determine if a nickname is registered - 21/11/10 08:56 PM

Elegant? You send the server a request and wait for the response. If you want elegance add some ;candles & ;roses to the script. I think simplicity would be more ideal.
Posted By: genius_at_work

Re: trying to determine if a nickname is registered - 21/11/10 09:30 PM

The /whois response for that user should (may) return a raw 307 indicating that the user has a registered nickname.

Similarly, the /who response for that user should contain the character 'r' in $7, indicating that the user has a registered nickname.

-genius_at_work
Posted By: Richard_B

Re: trying to determine if a nickname is registered - 22/11/10 01:39 AM

thanks for the RAW and WHO options, I will try them both out
© 2019 mIRC Discussion Forums