Exemplo n.º 1
0
 private void button7_Click(object sender, EventArgs e)
 {
     Timer_Cycle.Stop();
     Timer_List.Stop();
     Label_FL_Count.Text = "FL count: ";
     LabelNextCycle.Text = "Next Cycle in: ";
 }
Exemplo n.º 2
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++;
        }
Exemplo n.º 3
0
 private void Timer_Cycle_Tick(object sender, EventArgs e)
 {
     LabelNextCycle.Text = "Next Cycle in:" + timercycle;
     if (timercycle == 5)
     {
         bot.Read_Villages();
     }
     if (timercycle == 3)
     {
         bot.SwitchToFl(FLvillnum);
     }
     if (timercycle <= 0)
     {
         Timer_List.Start();
         Timer_Cycle.Stop();
         FL_num_sent = ListOfFL.Count;
         bot.Read_Villages();
     }
     timercycle--;
 }