mIRC Home    About    Download    Register    News    Help

Print Thread
trying to determine if a nickname is registered #227770 21/11/10 05:53 PM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36
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

Re: trying to determine if a nickname is registered [Re: Richard_B] #227773 21/11/10 08:56 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
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.

Re: trying to determine if a nickname is registered [Re: Richard_B] #227774 21/11/10 09:30 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Last edited by genius_at_work; 21/11/10 09:34 PM.
Re: trying to determine if a nickname is registered [Re: Richard_B] #227777 22/11/10 01:39 AM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36
thanks for the RAW and WHO options, I will try them both out