Ejemplo n.º 1
0
        public static void DragnDropFast(Point xy1, Point xy2)
        {
            SpecialEvents se    = new SpecialEvents();
            int           error = 0;
            string        x1;
            string        x2;

            do
            {
                if (error == 3)
                {
                    se.RestartBot();
                }
                x1 = MasterOfPictures.PixelIndicator(xy1);//контрольный пиксель
                MoveMouse(xy1);
                Thread.Sleep(100);
                LMBdown(xy1);
                Thread.Sleep(1000);
                MoveMouse(xy2);
                Thread.Sleep(2500);
                LMBup(xy2);
                Thread.Sleep(500);
                x2 = MasterOfPictures.PixelIndicator(xy1); //контрольный пиксель фото 2
                error++;
            } while (x1 == x2);                            //переместил ли машину
        }
        public bool ItsGarage()
        {
            if (StartIcon())
            {
                se.RestartBot();
            } //если свернулась игра
            bool x = MainFrame(PointsAndRectangles.inGarage, "InGarage");

            return(x);
        }
Ejemplo n.º 3
0
 public void CheckTime()
 {
     for (int i = 1; i < timings.Length; i += 2)
     {
         BreakTime bt = new BreakTime(timings[i], timings[i + 1]);
         if (bt.isTimeToBreak())
         {
             NotePad.DoLog("Time is over");
             SpecialEvents se = new SpecialEvents();
             se.RestartBot();
         }
     }
 }
Ejemplo n.º 4
0
        public void PrepareToRace(int i)
        {
            SpecialEvents se = new SpecialEvents();
            HandMaking    hm = new HandMaking();

            NotePad.DoLog("Rq = " + Condition.eventrq
                          + ", условие 1: " + Condition.ConditionNumber1
                          + ", условие 2: " + Condition.ConditionNumber2
                          + " заезд: " + i);

            int wronghandnumber = 0;//счетчик неправильного сбора руки

            do
            {
                if (wronghandnumber == 3)
                {
                    se.RestartBot();
                }
                else
                {
                    wronghandnumber++;

                    if (i == 1)
                    {
                        se.ClearHand();
                        Thread.Sleep(500);
                        NotePad.DoLog("Собираю пробную руку");
                        hm.MakingHand();
                    }

                    if (i == 2)//пересборка по покрытию
                    {
                        se.ClearHand();
                        Thread.Sleep(500);
                        NotePad.DoLog("Меняю руку с учетом покрытия и погоды");
                        hm.MakingHand();
                    }

                    Thread.Sleep(5000);

                    if (!hm.HandCarFixed() || !hm.VerifyHand())
                    {
                        se.ClearHand();
                        Thread.Sleep(500);
                        NotePad.DoLog("Меняю руку");
                        hm.MakingHand();
                    }
                }
            } while (!hm.VerifyHand());
        }
Ejemplo n.º 5
0
        public void TimeToRace()
        {
            FastCheck        fc = new FastCheck();
            SpecialEvents    se = new SpecialEvents();
            TrackInfo        ti = new TrackInfo();
            GrandArrangement ga = new GrandArrangement();

            int[] a1 = ti.Tracks();   //Track info
            int[] b1 = ti.Grounds();  //Ground info
            int[] c1 = ti.Weathers(); //Weather info

            bool raceIsEnd   = false;
            bool raceIsStart = false;
            int  waiter      = 0;

            do
            {
                if (waiter == 180)
                {
                    se.RestartBot();
                }
                se.UniversalErrorDefense();
                if (fc.ClubMap())
                {
                    NotePad.DoLog("вылетел из заезда");
                    raceIsEnd = true;
                }
                if (fc.Bounty())
                {
                    NotePad.DoLog("вылетел из заезда");
                    raceIsEnd = true;
                }
                if (fc.EnemyIsReady())
                {
                    Thread.Sleep(1000);
                    Rat.Clk(PointsAndRectangles.ChooseAnEnemy);//ChooseanEnemy
                    NotePad.DoLog("противник выбран");
                }
                if (fc.ArrangementWindow())
                {
                    NotePad.DoLog("загрузился экран расстановки");
                    Thread.Sleep(1000);
                    ga.Arrangement(a1, b1, c1);
                    NotePad.DoLog("расстановка выполнена");
                }
                if (fc.RaceOn() && !raceIsStart)
                {
                    raceIsStart = true;
                    NotePad.DoLog("заезд начался");
                    Thread.Sleep(2000);
                    Rat.Clk(PointsAndRectangles.forceTheRace); //ускорить заезд, клик в пусой области
                }
                if (!fc.RaceOn() && raceIsStart)
                {
                    NotePad.DoLog("заезд окончен");
                    raceIsEnd = true;
                }
                Thread.Sleep(1000);
                waiter++;
            } while (!raceIsEnd);
        }