Ejemplo n.º 1
0
        private void Timer_List_Tick_1(object sender, EventArgs e)
        {
            Label_FL_Count.Text = "FL to send: " + FL_num_sent;
            Label_Period.Text   = "timerlist: " + timerlist;
            int indexNum = ListOfFL.Count - FL_num_sent;

            if (timerlist > Helper.ReturnSec(2))
            {
                if (ListOfFL.ElementAt(indexNum).Enabled)
                {
                    Label_Period.Text = "Period number of " + ListOfFL.ElementAt(indexNum).FLName + " is " + ListOfFL.ElementAt(indexNum).Period_num;
                    if (ListOfFL.ElementAt(indexNum).Period <= ListOfFL.ElementAt(indexNum).Period_num)
                    {
                        try
                        {
                            count++;
                            Console.WriteLine("Sending FL " + indexNum + "   Count " + count);
                            ListOfFL.ElementAt(indexNum).Period_num = 1;
                            richTextBox1.Text = DateTime.Now.ToLocalTime() + ": Will send FL num: " + indexNum + " Total FL objects:" + ListOfFL.Count + "\n" + richTextBox1.Text;
                            bot.SendFarmlist(indexNum, ListOfFL.ElementAt(indexNum).Send2, ListOfFL.ElementAt(indexNum).Send3);
                        }
                        catch (Exception) {
                            richTextBox1.Text = DateTime.Now.ToLocalTime() + ": ERROR AT SENDING FL\n" + richTextBox1.Text;
                        }
                    }
                    else
                    {
                        ListOfFL.ElementAt(indexNum).Period_num++;
                    }
                }
                FL_num_sent--;
                Label_FL_Count.Text = "FL to send: " + FL_num_sent;
                timerlist           = 0;
            }

            if (FL_num_sent == 0)
            {
                timercycle = Helper.ReturnRandom(FL_min, FL_max);
                Timer_List.Stop();
                Timer_Cycle.Start();
            }
            timerlist++;
        }
Ejemplo n.º 2
0
 private void Start_Click(object sender, EventArgs e)
 {
     timercycle = 7;
     Timer_Cycle.Start();
 }