Guest User

thacrypte's bot

a guest
Sep 24th, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.40 KB | None | 0 0
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             /***
  6.              *      _______ _           ____        _  
  7.              *     |__   __| |         |  _ \      | |  
  8.              *        | |  | |__   __ _| |_) | ___ | |_
  9.              *        | |  | '_ \ / _` |  _ < / _ \| __|
  10.              *        | |  | | | | (_| | |_) | (_) | |_
  11.              *        |_|  |_| |_|\__,_|____/ \___/ \__|
  12.              *                                          
  13.              *                                          
  14.              */
  15.  
  16.             string BotServer = IrcClient.BotServer;
  17.             int BotPort = IrcClient.BotPort;
  18.             string BotName = IrcClient.BotName;
  19.             string BotPass = *****************
  20.             string BotChannel = IrcClient.DebugChannel;
  21.  
  22.             CommandHandler CH = new CommandHandler();
  23.             ServerMessages SMSG = new ServerMessages();
  24.  
  25.  
  26.             IrcClient.TogDebug = true;
  27.             IrcClient.IrcConnection(BotServer, BotPort, BotName, "");
  28.             while (true)
  29.             {
  30.                 string RawMessage = IrcClient.ReadMessage();
  31.                 string[] Message = RawMessage.Split(' ');
  32.  
  33.                 if (Message[1] == "PRIVMSG" && Message[2].Contains("#") && Message[2] != IrcClient.DebugChannel && IrcClient.TogDebug)
  34.                 {
  35.                     char[] removechars = new char[] { ':', '!', '@' };
  36.                     string[] UserName = Message[0].Split(removechars, StringSplitOptions.RemoveEmptyEntries);
  37.                     string Sentence = " ";
  38.                     for (int i = 3; i < Message.Length; i++)
  39.                     {
  40.                         Sentence += Message[i] + " ";
  41.                     }
  42.                     IrcClient.SendChatMessage(IrcClient.DebugChannel, string.Format("{0} \t {1} \t\t {2}", UserName[0], Message[2], Sentence) );
  43.                 }
  44.                
  45.  
  46.                 if (Message[0] == ":irc.sa-mp.im")
  47.                 {                  
  48.                         SMSG.ServerMessage(Message[1], Message);
  49.  
  50.                 }
  51.  
  52.                 if (RawMessage.StartsWith("PING"))
  53.                 {
  54.                     string[] reply = RawMessage.Split(' ');
  55.  
  56.                     IrcClient.SendIRCMessage(string.Format("PONG {0}", reply[1]));
  57.                     Console.WriteLine("Ping reply send to: " + reply[1]);
  58.                     if (IrcClient.TogDebug)
  59.                     {
  60.                         IrcClient.SendChatMessage(IrcClient.DebugChannel, "Received server ping");
  61.                     }
  62.                 }
  63.  
  64.  
  65.  
  66.  
  67.                
  68.  
  69.                 if(Message.Length >= 4 && Message[3].StartsWith(":."))
  70.                 {
  71.                     CH.OnCommand(Message[3], Message);
  72.                 }
  73.                 if (Message[0] == ":ThaCrypte!ThaCrypte@sa-mp.im" && Message[1] == "PRIVMSG" && Message[3] == ":!annoy")
  74.                 {
  75.                     string username = Message[4];
  76.                     string Sentence = "I was told to annoy you so here we go. " + username;
  77.                     for (int i = 0; i < 100; i++)
  78.                     {
  79.                         IrcClient.SendNotice(username, Sentence);
  80.                         IrcClient.SendChatMessage(IrcClient.DebugChannel, "NOTICE " + i + " TO " + username);
  81.                     }
  82.                 }
  83.  
  84.  
  85.                 //------------ END TEMPORARY
  86.             }
  87.         }
  88.     }
Add Comment
Please, Sign In to add comment