Stary2001

Untitled

Sep 23rd, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public static string GetNickserv(string nick)
  2. {
  3. string s = null;
  4.  
  5. irc.WriteLine("WHO " + nick + " %na");
  6. string resp = irc.ReadLine(true);
  7.  
  8. string[] split = resp.Split(new char[] { ' ' });
  9.  
  10. if (split[1] == "264") { Thread.Sleep(100); return GetNickserv(nick); }
  11.  
  12. if (split[1] == "354") // 0 is host!
  13. {
  14. if (split[4] != ":End")
  15. {
  16. s = split[4];
  17. irc.ReadLine(true); // to eat the "end of list" notification
  18. }
  19. }
  20. else
  21. {
  22.  
  23. return GetNickserv(nick); // try again!
  24. }
  25.  
  26. return s;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment