Example #1
0
        public static void Main(string[] args)
        {
            Console.Title = "Hatman";
            Console.Write("Reading config...");

            if (!File.Exists("Config.txt"))
            {
                Console.WriteLine("Config.txt not found." +
                    " \nPlease ensure the file can be found within the working directory.");
                Console.Read();
                return;
            }

            var email = "";
            var pass = "";
            ReadConfig(out email, out pass);

            Console.Write("done.\nLogging into SE...");
            chatClient = new Client(email, pass);

            Console.Write("done.\nJoining room...");
            chatRoom = chatClient.JoinRoom(roomURL, true);
            Extensions.SelfID = chatRoom.Me.ID;

            ChatEventRouter router = new ChatEventRouter(chatRoom);

            Console.WriteLine("done.\n");
            chatRoom.PostMessageLight("Hiya");

            router.ShutdownMre.WaitOne();

            chatRoom.PostMessageLight("Cya");
            chatRoom.Leave();
        }
Example #2
0
        public static void Main(string[] args)
        {
            Console.Title = "Hatman";
            Console.Write("Reading config...");

            if (!File.Exists("Config.txt"))
            {
                Console.WriteLine("Config.txt not found." +
                                  " \nPlease ensure the file can be found within the working directory.");
                Console.Read();
                return;
            }

            var email = "";
            var pass  = "";

            ReadConfig(out email, out pass);

            Console.Write("done.\nLogging into SE...");
            chatClient = new Client(email, pass);

            Console.Write("done.\nJoining room...");
            chatRoom          = chatClient.JoinRoom(roomURL, true);
            Extensions.SelfID = chatRoom.Me.ID;

            ChatEventRouter router = new ChatEventRouter(chatRoom);

            Console.WriteLine("done.\n");
            chatRoom.PostMessageLight("Hiya");

            router.ShutdownMre.WaitOne();

            chatRoom.PostMessageLight("Cya");
            chatRoom.Leave();
        }