Exemplo n.º 1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (b.con == 1)
     {
         label2.Text = "Twitch connected";
     }
     if (b.text == "")
     {
         if (b.msgs.Count != 0)
         {
             b.text = b.msgs[0];
             b.msgs.RemoveAt(0);
         }
     }
     if (b.text != "")
     {
         if (checkBox1.Checked)
         {
             int r = MemoryRead.SendMsg(b.text);
             if (r == 1)
             {
                 label1.Text = "Message was send to War2 successfully";
                 b.text      = "";
             }
             if (r == 2)
             {
                 label1.Text = "Waiting for War2 to receive message...";
             }
             if (r == 0)
             {
                 label1.Text = "War2 process not found";
             }
             if (r == 3)
             {
                 label1.Text = "War2Twitch plugin not found";
             }
         }
         else
         {
             b.text = "";
         }
     }
     if (b.client.IsConnected)
     {
         if (b.client.JoinedChannels.Count != 0)
         {
             if (checkBox2.Checked)
             {
                 MemoryRead.RecMsg();
                 if (MemoryRead.msgs.Count != 0)
                 {
                     label1.Text = "Received message from War2: " + MemoryRead.msgs[0];
                     //if (checkBox2.Checked)
                     b.client.SendMessage(b.chan, MemoryRead.msgs[0]);
                     MemoryRead.msgs.RemoveAt(0);
                 }
             }
         }
     }
 }