Esempio n. 1
0
        public SetMode(Menu _menu, CWindow window)
        {
            InitializeComponent();
            this.menu = _menu;

            this.parentWindow = window;
            this.lblName.Text = window.ChatName;
            ImportReplyModes();
        }
Esempio n. 2
0
        private void CheckForNewChat(IReadOnlyCollection<IWebElement> elemChatWindows)
        {
            for (int i = 0; i < elemChatWindows.Count; i++) {
                string sID = GetProfileLink(elemChatWindows.ElementAt(i));

                if (sID == null) {
                    continue;
                }
                if (!windows.ContainsKey(sID)) {
                    CWindow window = new CWindow(this, replier.Whitelist, elemChatWindows.ElementAt(i));
                    window.SetReplyMode(new CInherit());
                    window.ChatMsgReceived += window_ChatMsgReceived;

                    CDebug.Print("Added a new chat: " + window.ChatName, ConsoleColor.Green);
                    windows.Add(sID, window);
                    if (ChatAdded != null) {
                        ChatAdded(window);
                    }
                    this.replier.ChatAdded_(window);
                }
            }
        }
Esempio n. 3
0
 public virtual void Reply(CChatMaster chatMaster, CWindow window, CMessage message)
 {
 }
Esempio n. 4
0
 public virtual void Initialize(CWindow window)
 {
 }
Esempio n. 5
0
 public override void Reply(CChatMaster chatMaster, CWindow window, CMessage message)
 {
     chatMaster.SendMessageToWindow(window, GetInsult());
     base.Reply(chatMaster, window, message);
 }
Esempio n. 6
0
 public override void Reply(CChatMaster chatMaster, CWindow window, CMessage message)
 {
     chatMaster.SendMessageToWindowNoSend(window, "AAA");
     base.Reply(chatMaster, window, message);
 }
Esempio n. 7
0
        public override void Reply(CChatMaster chatMaster, CWindow window, CMessage message)
        {
            string msg = message.Message.ToLower().Trim();
            RPS _r = RPS.Paper;

            if (msg.StartsWith("rock")) {
                _r = RPS.Rock;
            } else if (msg.StartsWith("paper")) {
                _r = RPS.Paper;
            } else if (msg.StartsWith("scissors")) {
                _r = RPS.Scissors;
            } else {
                chatMaster.SendMessageToWindow(window, "Hi, " + window.ChatName + ". I'm not available right now; but how about some rock, paper scissors? You can go first!");
                return;
            }

            Random r = new Random();
            RPS r1 = (RPS)r.Next(0, 2);
            chatMaster.SendMessageToWindow(window, "I chose " + r1.ToString());

            int iWinner = Logic(_r, r1);
            switch (iWinner) {
                case -1:
                    chatMaster.SendMessageToWindow(window, "Looks like that was a draw!");
                    break;

                case 0:
                    chatMaster.SendMessageToWindow(window, "Looks like I won that one!!! :D");
                    break;

                case 1:
                    chatMaster.SendMessageToWindow(window, "Ok, you won that one. :/");
                    break;
            }

            base.Reply(chatMaster, window, message);
        }
Esempio n. 8
0
 private void autoreplier_ChatRemoved(CWindow window)
 {
     ImportUsers();
 }
Esempio n. 9
0
 public void ChatMsgReceived_(CWindow window, CMessage message)
 {
     if (this.ChatMessageReceived != null) {
         this.ChatMessageReceived(window, message);
     }
 }
Esempio n. 10
0
 public void WhitelistUser(CWindow window)
 {
     WhitelistUser(window.ChatName, window.ProfileLink);
 }
Esempio n. 11
0
 public override void Reply(CChatMaster chatMaster, CWindow window, CMessage message)
 {
     chatMaster.ParentReplyMode.Reply(chatMaster, window, message);
     base.Reply(chatMaster, window, message);
 }
Esempio n. 12
0
 public void SyncReplyMode(CWindow window)
 {
     window.SetReplyMode(chatMaster.ParentReplyMode);
 }
Esempio n. 13
0
 public void ChatRemoved_(CWindow window)
 {
     if (this.ChatRemoved != null) {
         this.ChatRemoved(window);
     }
 }
Esempio n. 14
0
 private void window_ChatMsgReceived(CWindow window, CMessage message)
 {
     CDebug.Print("Chat message from " + window.ChatName + ", at " +
         message.TimeReceived + ": " + message.Message, ConsoleColor.DarkGray);
     this.replier.ChatMsgReceived_(window, message);
 }
Esempio n. 15
0
        public override void Reply(CChatMaster chatMaster, CWindow window, CMessage message)
        {
            char[] strArray = message.Message.ToArray();
            Array.Reverse(strArray);

            string strReversed = new string(strArray);
            chatMaster.SendMessageToWindow(window, strReversed);
            base.Reply(chatMaster, window, message);
        }
Esempio n. 16
0
 public void SendMessageToWindowNoSend(CWindow window, string sMessage)
 {
     process.Process(new CTypeMessage(driver, window, new CMessage(sMessage, null, null)));
 }
Esempio n. 17
0
 private void autoreplier_ChatMessageReceived(CWindow window, CMessage message)
 {
     // TODO: Is this necessary?
 }