Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- /***
- * _______ _ ____ _
- * |__ __| | | _ \ | |
- * | | | |__ __ _| |_) | ___ | |_
- * | | | '_ \ / _` | _ < / _ \| __|
- * | | | | | | (_| | |_) | (_) | |_
- * |_| |_| |_|\__,_|____/ \___/ \__|
- *
- *
- */
- string BotServer = IrcClient.BotServer;
- int BotPort = IrcClient.BotPort;
- string BotName = IrcClient.BotName;
- string BotPass = *****************
- string BotChannel = IrcClient.DebugChannel;
- CommandHandler CH = new CommandHandler();
- ServerMessages SMSG = new ServerMessages();
- IrcClient.TogDebug = true;
- IrcClient.IrcConnection(BotServer, BotPort, BotName, "");
- while (true)
- {
- string RawMessage = IrcClient.ReadMessage();
- string[] Message = RawMessage.Split(' ');
- if (Message[1] == "PRIVMSG" && Message[2].Contains("#") && Message[2] != IrcClient.DebugChannel && IrcClient.TogDebug)
- {
- char[] removechars = new char[] { ':', '!', '@' };
- string[] UserName = Message[0].Split(removechars, StringSplitOptions.RemoveEmptyEntries);
- string Sentence = " ";
- for (int i = 3; i < Message.Length; i++)
- {
- Sentence += Message[i] + " ";
- }
- IrcClient.SendChatMessage(IrcClient.DebugChannel, string.Format("{0} \t {1} \t\t {2}", UserName[0], Message[2], Sentence) );
- }
- if (Message[0] == ":irc.sa-mp.im")
- {
- SMSG.ServerMessage(Message[1], Message);
- }
- if (RawMessage.StartsWith("PING"))
- {
- string[] reply = RawMessage.Split(' ');
- IrcClient.SendIRCMessage(string.Format("PONG {0}", reply[1]));
- Console.WriteLine("Ping reply send to: " + reply[1]);
- if (IrcClient.TogDebug)
- {
- IrcClient.SendChatMessage(IrcClient.DebugChannel, "Received server ping");
- }
- }
- if(Message.Length >= 4 && Message[3].StartsWith(":."))
- {
- CH.OnCommand(Message[3], Message);
- }
- if (Message[0] == ":ThaCrypte!ThaCrypte@sa-mp.im" && Message[1] == "PRIVMSG" && Message[3] == ":!annoy")
- {
- string username = Message[4];
- string Sentence = "I was told to annoy you so here we go. " + username;
- for (int i = 0; i < 100; i++)
- {
- IrcClient.SendNotice(username, Sentence);
- IrcClient.SendChatMessage(IrcClient.DebugChannel, "NOTICE " + i + " TO " + username);
- }
- }
- //------------ END TEMPORARY
- }
- }
- }
Add Comment
Please, Sign In to add comment