Advertisement
Blizzardo1

Blizzeta Dynamic Test Code

Feb 21st, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1. /*
  2.     Copyright (c) 2013, Blizzeta Software and Gaming ( Adonis S. Deliannis )
  3.         * Test Code *
  4. */
  5.  
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Net;
  11. using System.Net.Sockets;
  12. using System.Text;
  13.  
  14. namespace IRC
  15. {
  16.     internal class Program
  17.     {
  18.         static dynamic tcp = new TcpClient();
  19.         static dynamic writer;
  20.         static dynamic reader;
  21.         static dynamic cmd;
  22.  
  23.         static dynamic Server = "";
  24.         static dynamic SelectedServer;
  25.         static dynamic Port = 6667;
  26.  
  27.         static dynamic Channel = "#";
  28.         static dynamic Nick = "";
  29.         static dynamic Realname = "";
  30.         static dynamic Username = "";
  31.         static dynamic NickServPass = ""; // Use if you want to identify your Bot
  32.         static dynamic Mode = 8;
  33.  
  34.         static void Main(string[] args)
  35.         {
  36.             tcp.Connect(Server, Port);
  37.  
  38.             while (tcp.Connected)
  39.             {
  40.                 writer = new StreamWriter(tcp.GetStream());
  41.                 reader = new StreamReader(tcp.GetStream());
  42.  
  43.                 WriteLine("NICK {0}", Nick);
  44.                 WriteLine("USER {0} {1} * : {2}", Username, Mode, Realname);
  45.                 WriteLine("JOIN {0}", Channel);
  46.  
  47.                 while ((cmd = reader.ReadLine()) != null)
  48.                 {
  49.                     SelectedServer = cmd.Split(' ')[0];
  50.                     SelectedServer = SelectedServer.Trim(':');
  51.                     Console.WriteLine(cmd);
  52.                 }
  53.             }
  54.  
  55.             Console.ReadKey(true);
  56.         }
  57.  
  58.         static void WriteLine(string Text, params object[] Parameters)
  59.         {
  60.             writer.WriteLine(Text, Parameters);
  61.             writer.Flush();
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement