Advertisement
SteelGolem

irc stuff with kishi

Jan 3rd, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             string data = ":irc.rizon.net PRIVMSG kishi :!say #SteelGolem hello alll";
  13.             string[] ex = data.Split(' ');
  14.  
  15.             string command = ex[3];
  16.             switch (command)
  17.             {
  18.                 case ":!say":
  19.                     string channel = ex[4];
  20.                     int start_of_message = data.IndexOf(channel) + channel.Length + 1;
  21.                     if (start_of_message < data.Length)
  22.                         SendData("PRIVMSG ", data.Substring(start_of_message));
  23.                     break;
  24.             }
  25.         }
  26.  
  27.         static void SendData(string command, string what)
  28.         {
  29.             Console.WriteLine(command + " > " + what);
  30.             Console.ReadKey(false);
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement