public void UpgradeAdsKiller()//switch off ads watching
 {
     NotePad.DoLog("Пропускаю рекламу на прокачку");
     Rat.Clk(PointsAndRectangles.upgradeCancelation); //отменить просмотр
     Thread.Sleep(3000);
     UniversalErrorDefense();
 }
        public static int AvailableCars(int carClass)
        {
            int number = 0;

            int[] overNumber = { slikTyres[carClass],
                                 dynamicTyres[carClass],
                                 standartTyres[carClass],
                                 allseasonTyres[carClass],
                                 offroadTyres[carClass] };
            for (int i = 0; i < 5; i++)
            {
                if (tires[i])
                {
                    number += overNumber[i];
                }
            }

            if (number > 4)
            {
                if (number % 2 == 0)
                {
                    number -= 2;
                    NotePad.DoLog("недостигаемы 2 машины");
                }
                else
                {
                    number -= 1;
                    NotePad.DoLog("недостигаема 1 машина");
                }
            } //исключаем сломаные места
            return(number);
        }     //доступные машины
 public static int[] LowestClassCars()
 {
     int[] classes = { 0, 0, 0, 0, 0 }; //f f f f f
     for (int i = 0; i < lowestRqCars.Length; i++)
     {
         if (lowestRqCars[i] > 19)
         {
             classes[i] = 1;                      //e
         }
         if (lowestRqCars[i] > 29)
         {
             classes[i] = 2;                      //d
         }
         if (lowestRqCars[i] > 39)
         {
             classes[i] = 3;                      //c
         }
         if (lowestRqCars[i] > 49)
         {
             classes[i] = 4;                      //b
         }
         if (lowestRqCars[i] > 64)
         {
             classes[i] = 5;                      //a
         }
         if (lowestRqCars[i] > 79)
         {
             classes[i] = 6;                      //s
         }
     }
     NotePad.DoLog("Стартовые классы для условия " + classes[0] + " " + classes[1] + " " + classes[2] + " " + classes[3] + " " + classes[4]);
     return(classes);
 }
Esempio n. 4
0
        public void ChooseNormalEvent()
        {
            SpecialEvents se = new SpecialEvents();

            NotePad.DoLog("Проверяю событие");
            bool eventIsOK = false;

            while (!eventIsOK)
            {
                for (int i = 1; i < 5; i++)
                {
                    do
                    {
                        se.MissClick();
                        se.ToClubs();
                    } while (!fc.ClubMap());

                    Thread.Sleep(500);
                    NotePad.DoLog("Проверяю условие " + i);
                    eventIsOK = Selection(i);

                    if (!eventIsOK)
                    {
                        Rat.Clk(PointsAndRectangles.toeventlist);//Back
                        Thread.Sleep(3000);
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }
        public bool HandCarFixed()
        {
            string path = "Check//";

            bool x = true;

            Rectangle[] bounds = new Rectangle[] { PointsAndRectangles.HandSlot1, PointsAndRectangles.HandSlot2, PointsAndRectangles.HandSlot3, PointsAndRectangles.HandSlot4, PointsAndRectangles.HandSlot5 };
            string[]    n      = new string[] { "finger1", "finger2", "finger3", "finger4", "finger5" };
            for (int i = 0; i < 5; i++)
            {
                MasterOfPictures.MakePicture(bounds[i], path + n[i] + "0");
            }
            Thread.Sleep(2000);
            for (int j = 0; j < 5; j++)
            {
                MasterOfPictures.MakePicture(bounds[j], path + n[j] + "1");
            }

            for (int k = 0; k < 5; k++)
            {
                if (!MasterOfPictures.Verify(path + n[k] + "0", path + n[k] + "1"))
                {
                    NotePad.DoLog("Тачка на " + (k + 1) + " месте неисправна");
                    x = false;
                    break;
                }
            }
            return(x);
        }
Esempio n. 6
0
        public Car(int carPicture)
        {
            IdentifyCar(carPicture);

            foreach (CarForExcel car in CarsDB.fulltablearray)
            {
                if (car.fullname() == carname)
                {
                    NotePad.DoLog(carname);
                    clearance = clearanceConverter(car.clearance);
                    tires     = tiresConverter(car.tires);
                    drive     = driveConverter(car.drive);
                    try
                    {
                        acceleration = Convert.ToDouble(car.acceleration);
                    }
                    catch
                    {
                        NotePad.DoErrorLog("can not convert " + car.acceleration + " to double");
                    }
                    maxSpeed = Convert.ToInt32(car.speed);
                    grip     = Convert.ToInt32(car.grip);
                    weight   = Convert.ToInt32(car.weight);
                    break;
                }
            }
        }
        private void Randomizer()
        {
            FastCheck fc = new FastCheck();

            Point[] a    = new Point[] { PointsAndRectangles.r1, PointsAndRectangles.r2, PointsAndRectangles.r3, PointsAndRectangles.r4, PointsAndRectangles.r5, PointsAndRectangles.r6, PointsAndRectangles.r7, PointsAndRectangles.r8, PointsAndRectangles.r9, PointsAndRectangles.r10 };
            Random  rand = new Random();

            while (!fc.ItsGarage())
            {
                Thread.Sleep(2000);
            }

            if ((Condition.ConditionNumber1 == "экстремальная" && Condition.eventrq < 320) ||//условие определееной редкости
                (Condition.ConditionNumber1 == "редкостная" && Condition.eventrq < 195) ||
                (Condition.ConditionNumber1 == "необычная" && Condition.eventrq < 145) ||
                (Condition.ConditionNumber1 == "суперская" && Condition.eventrq < 245) ||
                Condition.eventrq < 95)
            {
                NotePad.DoLog("сортирую по рк");
                Thread.Sleep(200);
                do
                {
                    Rat.Clk(PointsAndRectangles.sorting); //сортировка
                    Thread.Sleep(1000);
                } while (!fc.TypeIsOpenned());            //100% SorterOpenner
                Thread.Sleep(200);
                Rat.Clk(PointsAndRectangles.clearall);    //сброс
                Thread.Sleep(1000);
                Rat.Clk(PointsAndRectangles.sorting);     //сортировка
                Thread.Sleep(1000);
                Rat.Clk(PointsAndRectangles.r2);          //сортировка по рк
            }
            else
            {
                Thread.Sleep(200);
                do
                {
                    Rat.Clk(PointsAndRectangles.sorting); //сортировка
                    Thread.Sleep(1000);
                } while (!fc.TypeIsOpenned());            //100% SorterOpenner
                Thread.Sleep(200);
                int r = rand.Next(10);
                if (rand.Next(2) == 1)
                {
                    Rat.Clk(a[r]);//выбрать условие
                    Thread.Sleep(200);
                }
                Rat.Clk(a[r]);//выбрать условие
            }

            Thread.Sleep(500);
            do
            {
                Rat.Clk(PointsAndRectangles.closesorting); //закрыть сортировку
                Thread.Sleep(500);
            } while (fc.TypeIsOpenned());                  //100% SorterCloser
            Thread.Sleep(4000);
        }
        public bool EnemyIsReady()
        {
            bool x = MainFrameBW(PointsAndRectangles.chooseanEnemy, "ChooseanEnemy", 90);

            if (x)
            {
                NotePad.DoLog("противник загрузился, готов фотать трассы");
            }
            return(x);
        }
        /*
         * public bool FaultNox()
         * {
         *  bool x = MainFrame(PointsAndRectangles.faultNox, "FaultNox");
         *  return x;
         * }*/

        public bool InCommonEvent()
        {
            bool x = MainFrameBW(PointsAndRectangles.inCommonEvent, "InCommonEvent", 10);

            if (x)
            {
                NotePad.DoLog("Зашел в событие");
            }
            return(x);
        }
        public bool RaceEnd()
        {
            bool x = MainFrameBW(PointsAndRectangles.raceEnd, "RaceEnd", 220);

            if (x)
            {
                NotePad.DoLog("первую трассу проехал, жму пропуск");
            }
            return(x);
        }
Esempio n. 11
0
        public bool Selection(int eventN)
        {
            SpecialEvents se = new SpecialEvents();

            Point[] events = { PointsAndRectangles.eventN1, PointsAndRectangles.eventN2, PointsAndRectangles.eventN3, PointsAndRectangles.eventN4 };

            bool eventIsOK = false;

            bool flag;

            do
            {
                flag = true;
                NotePad.DoLog("Кликаю событие " + eventN);
                Rat.Clk(events[eventN - 1]);
                Thread.Sleep(4000);
                if (fc.EventPage())
                {
                    NotePad.DoLog("Вылетел из клубов");
                    Rat.Clk(PointsAndRectangles.clktoClubs);//Clubs
                    flag = false;
                    Thread.Sleep(15000);
                }
                se.UniversalErrorDefense();
                Thread.Sleep(2000);
            } while (flag == false);//клик эвента и обработка ошибок

            MasterOfPictures.MakePicture(PointsAndRectangles.Condition1Bounds, @"Condition1\test");
            MasterOfPictures.MakePicture(PointsAndRectangles.Condition2Bounds, @"Condition2\test");
            string cond1 = ConvertPictureToCond(DefineFirstEvevntConditionByPicture(), 1);
            string cond2 = ConvertPictureToCond(DefineSecondEvevntConditionByPicture(), 2);

            if (cond1 != "unknown" && cond2 != "unknown")//Исключаю неизвестный
            {
                eventIsOK = true;
                Condition.MakeCondition(cond1, cond2);
                if (GotRQ() && Condition.minrq != 0)
                {
                    NotePad.DoLog("Минимальное рк для события " + Condition.minrq);
                    NotePad.DoLog("Требуемое рк для события " + Condition.eventrq);
                    if (Condition.minrq > Condition.eventrq || Condition.minrq > accountLVL)
                    {
                        NotePad.DoLog("Минимальное рк для события больше требуемого");
                        eventIsOK = false;
                    }
                }
            }
            if (!eventIsOK && eventN == 4)
            {
                Rat.Clk(PointsAndRectangles.clkoutofClubs);
            }

            return(eventIsOK);
        }
        public int[] ConditionHandling()
        {
            int[] rqclass = new int[] { 19, 29, 39, 49, 64, 79, 100 }; //рк для классов

            Random r      = new Random();
            int    handrq = 0;

            Condition.ActualRQ();
            NotePad.DoLog("Искомое РК " + Condition.actualRQ);

            int[] finger = Condition.LowestClassCars();
            for (int x = 0; x < 5; x++)
            {
                handrq += rqclass[finger[x]];
            }//начальная рука
            int n;

            while (Condition.actualRQ - handrq > 0)
            {
                do
                {
                    n = r.Next(0, 5);
                } while (finger[n] == Condition.maxclass);
                finger[n]++;

                handrq = 0;
                for (int x = 0; x < 5; x++)
                {
                    handrq += rqclass[finger[x]];
                }
            }//сборка руки

            NotePad.DoLog("требуемое рк: " + Condition.eventrq + ";   рк руки: " + handrq);

            for (int l = 0; l < 4; l++)
            {
                for (int l1 = 0; l1 < (4 - l); l1++)
                {
                    if (finger[l1] > finger[l1 + 1])
                    {
                        int remember = finger[l1];
                        finger[l1]     = finger[l1 + 1];
                        finger[l1 + 1] = remember;
                    }
                }
            }//сортировка карт по возрастанию

            int[] classcars = { 0, 0, 0, 0, 0, 0, 0 };
            for (int k = 0; k < finger.Length; k++)
            {
                classcars[finger[k]]++;
            }
            return(classcars);//порядок F,E,D,C,B,A,S
        }
        public void MissClick()
        {
            FastCheck fc = new FastCheck();

            if (fc.MissClick())
            {
                NotePad.DoLog("Промах");
                Rat.Clk(PointsAndRectangles.missClickCancelation);
                NotePad.DoLog("Исправился");
                Thread.Sleep(1000);
            }
        }
Esempio n. 14
0
        public int[] Weathers()
        {
            Rectangle[] c = { PointsAndRectangles.Weather1, PointsAndRectangles.Weather2, PointsAndRectangles.Weather3, PointsAndRectangles.Weather4, PointsAndRectangles.Weather5 };
            int         n;
            bool        flag;

            int[] c1 = new int[5];

            for (int i = 0; i < 5; i++)
            {
                flag = true;
                MasterOfPictures.BW2Capture(c[i], ("Weather" + (i + 1) + "\\test"));
                n = 0;
                for (int i1 = 1; i1 < 10; i1++)
                {
                    if (File.Exists(weatherDirectory + (i + 1) + "\\" + i1 + ".jpg"))
                    {
                        n = i1;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int i2 = 1; i2 < (n + 1); i2++)
                {
                    if (MasterOfPictures.VerifyBW(("Weather" + (i + 1) + "\\" + i2), ("Weather" + (i + 1) + "\\test"), 30))
                    {
                        c1[i] = i2;
                        File.Delete(weatherDirectory + (i + 1) + "\\test.jpg");
                        flag = false;
                        break;
                    }
                }

                if (flag == true)
                {
                    c1[i] = 0;
                    NotePad.DoLog("Добавляю новую погоду");
                    try
                    {
                        File.Move(weatherDirectory + (i + 1) + "\\test.jpg", weatherDirectory + (i + 1) + "\\" + (n + 1) + ".jpg");
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }

            return(c1);
        }
Esempio n. 15
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();
         }
     }
 }
Esempio n. 16
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());
        }
        public bool UnavailableEvent()
        {
            FastCheck fc = new FastCheck();
            bool      x  = true;

            if (fc.WrongParty())
            {
                NotePad.DoLog("Косячная рука");
                RestartBot();
            }

            if (fc.EventEnds())
            {
                NotePad.DoLog("эвент окончен");
                Rat.Clk(PointsAndRectangles.eventEndsAcceptance);//Accept Message
                Thread.Sleep(3000);
                x = false;
            }

            if (fc.EventIsNotAvailable())
            {
                NotePad.DoLog("эвент не доступен");
                Rat.Clk(PointsAndRectangles.eventIsNotAvailableAcceptance);//Accept Message
                Thread.Sleep(3000);
                if (fc.ItsGarage())
                {
                    RestartBot();
                }
                x = false;
            }

            if (fc.EventisFull())
            {
                NotePad.DoLog("эвент заполнен");
                Rat.Clk(PointsAndRectangles.eventIsFullAcceptance);//Accept Message

                if (fc.ItsGarage())
                {
                    Rat.Clk(PointsAndRectangles.buttonBack); //back
                    Thread.Sleep(2000);
                    Rat.Clk(PointsAndRectangles.buttonBack); //back to club map
                }
                Thread.Sleep(3000);
                x = false;
            }
            return(x);
        }
Esempio n. 18
0
        public string[,] TrackPackage(int[] trackName, int[] coverage, int[] weather)
        {
            string[] a2 = IdentifyTracks(trackName);
            string[] b2 = IdentifyGround(coverage);
            string[] c2 = IdentifyWeather(weather);
            string[,] d = new string[3, 5];
            for (int i = 0; i < 5; i++)
            {
                d[0, i] = a2[i];
                d[1, i] = b2[i];
                d[2, i] = c2[i];

                NotePad.DoLog((i + 1) + " Трэк: " + d[0, i] + " " + d[1, i] + " " + d[2, i]);
            }

            return(d);
        }
Esempio n. 19
0
        public int[] Tracks()
        {
            int  n;
            bool flag;

            Rectangle[] a  = { PointsAndRectangles.Track1, PointsAndRectangles.Track2, PointsAndRectangles.Track3, PointsAndRectangles.Track4, PointsAndRectangles.Track5 };
            int[]       a1 = new int[5];

            for (int i = 0; i < 5; i++)
            {
                flag = true;
                MasterOfPictures.TrackCapture(a[i], ("Track" + (i + 1) + "\\test"));
                n = 0;
                for (int i1 = 1; i1 < 100; i1++)
                {
                    if (File.Exists(trackDirectory + (i + 1) + "\\" + i1 + ".jpg"))
                    {
                        n = i1;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int i2 = 1; i2 < (n + 1); i2++)
                {
                    if (MasterOfPictures.VerifyBW(("Track" + (i + 1) + "\\" + i2), ("Track" + (i + 1) + "\\test"), 120))
                    {
                        a1[i] = i2;
                        File.Delete(trackDirectory + (i + 1) + "\\test.jpg");
                        flag = false;
                        break;
                    }
                }

                if (flag == true)
                {
                    a1[i] = 0;
                    NotePad.DoLog("Добавляю новый трэк");
                    File.Move(trackDirectory + (i + 1) + "\\test.jpg", trackDirectory + (i + 1) + "\\" + (n + 1) + ".jpg");
                }
            }

            return(a1);
        }
Esempio n. 20
0
        bool GotRQ()
        {
            bool isRqKnown = false;

            Condition.eventrq = 0;
            MasterOfPictures.MakePicture(PointsAndRectangles.RQBounds, RQPath);
            for (int i = 1; i < 501; i++)
            {
                if (File.Exists(@"C:\Bot\RQ\" + i + ".jpg"))
                {
                    if (MasterOfPictures.Verify(RQPath, @"RQ\" + i))
                    {
                        Condition.eventrq = i;
                        NotePad.DoLog("рк =  " + Condition.eventrq);
                        break;
                    }
                }
            }

            if (Condition.eventrq == 0)
            {
                NotePad.DoLog("Unknown rq");
                for (int x = 1; x < 500; x++)
                {
                    if (File.Exists(@"C:\Bot\RQ\UnknownRQ" + x + ".jpg"))
                    {
                        if (MasterOfPictures.Verify(RQPath, (@"RQ\UnknownRQ" + x)))
                        {
                            break;
                        }
                    }
                    else
                    {
                        File.Move(@"C:\Bot\" + RQPath + ".jpg", @"C:\Bot\RQ\UnknownRQ" + x + ".jpg");
                        break;
                    }
                }
            }
            else
            {
                isRqKnown = true;
            }

            return(isRqKnown);
        }
Esempio n. 21
0
        public int[] Grounds()
        {
            Rectangle[] b = { PointsAndRectangles.Ground1, PointsAndRectangles.Ground2, PointsAndRectangles.Ground3, PointsAndRectangles.Ground4, PointsAndRectangles.Ground5 };
            int         n;
            bool        flag;

            int[] b1 = new int[5];
            for (int i = 0; i < 5; i++)
            {
                flag = true;
                MasterOfPictures.BW2Capture(b[i], ("Ground" + (i + 1) + "\\test"));
                n = 0;
                for (int i1 = 1; i1 < 100; i1++)
                {
                    if (File.Exists(groundDirectory + (i + 1) + "\\" + i1 + ".jpg"))
                    {
                        n = i1;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int i2 = 1; i2 < (n + 1); i2++)
                {
                    if (MasterOfPictures.VerifyBW(("Ground" + (i + 1) + "\\" + i2), ("Ground" + (i + 1) + "\\test"), 150))
                    {
                        b1[i] = i2;
                        File.Delete(groundDirectory + (i + 1) + "\\test.jpg");
                        flag = false;
                        break;
                    }
                }

                if (flag == true)
                {
                    b1[i] = 0;
                    NotePad.DoLog("Добавляю новое покрытие");
                    File.Move(groundDirectory + (i + 1) + "\\test.jpg", groundDirectory + (i + 1) + "\\" + (n + 1) + ".jpg");
                }
            }

            return(b1);
        }
 public void InClubs()
 {
     while (true)
     {
         se.ToClubs();
         TimingUnit tu = new TimingUnit();
         tu.CheckTime();
         Thread.Sleep(2000);
         int i = 0;
         if (fc.ActiveEvent())
         {
             NotePad.DoLog("вхожу в активный эвент");
             i = 1;
             Rat.Clk(PointsAndRectangles.clubEventEnter);//ClubEventEnter
             string[] conds = NotePad.ReadConditions();
             Condition.eventrq = NotePad.ReadRQ();
             Condition.MakeCondition(conds[0], conds[1]);
             while (i < 100)
             {
                 i++;
                 if (!PlayClubs(i))
                 {
                     break;
                 }
             }
         }
         else
         {
             NotePad.DoLog("Подбираю эвент с одним условием");
             ce.ChooseNormalEvent();
             NotePad.DoLog("Вхожу в эвент " + Condition.eventrq + " рк");
             Rat.Clk(PointsAndRectangles.clubEventEnter);//ClubEventEnter
             while (i < 100)
             {
                 i++;
                 if (!PlayClubs(i))
                 {
                     break;
                 }
             }
         }
     }
 }
        public bool VerifyHand()
        {
            FastCheck fc = new FastCheck();

            bool x = true;

            Thread.Sleep(2000);

            if (fc.AnyHandSlotIsEmpty())
            {
                x = false;
            }

            if (fc.RedReadytoRace())
            {
                NotePad.DoLog("Рука не соответствует условию");
                x = false;
            }

            return(x);
        }
 public static void MakeCondition(string number1, string number2)
 {
     ConditionNumber1 = number1;
     ConditionNumber2 = number2;
     weather          = "с прояснением";
     coverage         = "Смешанное";
     CarsDB.MakeCondAuto(number1, number2);
     lowestRqCars   = CarsDB.lowestcars;
     slikTyres      = CarsDB.slikTyres;
     dynamicTyres   = CarsDB.dynamicTyres;
     standartTyres  = CarsDB.standartTyres;
     allseasonTyres = CarsDB.allseasonTyres;
     offroadTyres   = CarsDB.offroadTyres;
     minrq          = 0;
     for (int i = 0; i < 5; i++)
     {
         minrq += lowestRqCars[i];
     }
     MaxRq();
     NotePad.DoLog("Условия сформированы");
 }
        public int CheckHandSlot(int startslot, int endslot)
        {
            int x = 0;

            Rectangle[] handSlots = { PointsAndRectangles.HandSlot1,
                                      PointsAndRectangles.HandSlot2,
                                      PointsAndRectangles.HandSlot3,
                                      PointsAndRectangles.HandSlot4,
                                      PointsAndRectangles.HandSlot5 };

            for (int i = (startslot - 1); i < endslot; i++)
            {
                bool y = MainFrame(handSlots[i], "CarSlot" + i);
                if (y)
                {
                    NotePad.DoLog("Тачка на " + (i + 1) + " позиции отсутствует");
                    x++;
                }
            }

            return(x);
        }
Esempio n. 26
0
        public string ConvertPictureToCond(int picture, int cond)
        {
            string name   = "unknown";
            int    length = NotePad.GetInfoFileLength(@"C:\Bot\Condition" + cond + @"\info.txt");

            string[,] theTable = NotePad.ReadInfoFromTXT(@"C:\Bot\Condition" + cond + @"\info.txt");
            for (int i = 0; i < length; i++)
            {
                if (picture == Convert.ToInt32(theTable[i, 0]))
                {
                    name = theTable[i, 1];
                    NotePad.DoLog(cond + " условие: " + name);
                    break;
                }
            }
            if (name == "unknown")
            {
                NotePad.DoErrorLog("Неизвестное условие");
            }

            return(name);
        }
Esempio n. 27
0
        int DefineEvevntConditionByPicture(int conditionNumber)
        {
            int x;

            for (x = 0; x < 500; x++)
            {
                if (File.Exists(@"C:\Bot\Condition" + conditionNumber + @"\C" + x + ".jpg"))
                {
                    if (MasterOfPictures.Verify("Condition" + conditionNumber + @"\test", ("Condition" + conditionNumber + @"\C" + x)))
                    {
                        NotePad.DoLog(conditionNumber + " условие: " + x);
                        break;
                    }
                }
                else
                {
                    NotePad.DoLog("Неизвестное условие");
                    for (int i = 1; i < 500; i++)
                    {
                        if (File.Exists(@"C:\Bot\Condition" + conditionNumber + @"\UnknownCondition" + i + ".jpg"))
                        {
                            if (MasterOfPictures.Verify("Condition" + conditionNumber + @"\test", ("Condition" + conditionNumber + @"\UnknownCondition" + i)))
                            {
                                break;
                            }
                        }
                        else
                        {
                            File.Move(@"C:\Bot\" + "Condition" + conditionNumber + @"\test" + ".jpg", @"C:\Bot\Condition" + conditionNumber + @"\UnknownCondition" + i + ".jpg");
                            break;
                        }
                    }
                    x = 500;
                    break;
                }
            }

            return(x);
        }
        public void AcceptDailyBounty()
        {
            FastCheck fc = new FastCheck();
            bool      bountyisavailable = false;

            int clkcounter = 0;

            NotePad.DoLog("принимаю ежедневку");
            do
            {
                if (clkcounter > 25)
                {
                    RestartBot();
                }
                if (fc.DailyBounty())
                {
                    Rat.Clk(PointsAndRectangles.dailyBountyStart);
                    bountyisavailable = true;
                    Thread.Sleep(15000);
                }
                else
                if (fc.DailyBountyEnd())
                {
                    Rat.Clk(PointsAndRectangles.confirmdailyBountyEnd);
                    bountyisavailable = false;
                    Thread.Sleep(15000);
                }
                else if (bountyisavailable)
                {
                    Rat.Clk(PointsAndRectangles.dailyBountyThrow);
                    clkcounter++;
                }
                Thread.Sleep(15000);
            } while (bountyisavailable);
            NotePad.DoLog("принял ежедневку");
            RestartBot();
        }
Esempio n. 29
0
        void IdentifyCar(int carPicture)
        {
            string path = @"C:\Bot\NewPL\PictureToCar.txt";

            using (StreamReader sr = new StreamReader(path, System.Text.Encoding.Default))
            {
                string line;
                while ((line = sr.ReadLine()) != null && line != " " && line != "")
                {
                    if (carPicture.ToString().Equals(NotePad.GetWordFromString(line, 1)))
                    {
                        carname = NotePad.GetWordFromString(line, 2);
                        NotePad.DoLog("машина определена: " + carname);
                        break;
                    }
                }
                sr.Close();
            }

            if (carname == "unknown" && carPicture != 10000)
            {
                NotePad.DoErrorLog(carPicture + " is unknown car");
            }
        }
        private bool PlayClubs(int i)
        {
            SpecialEvents      se   = new SpecialEvents();
            Waiting            wait = new Waiting();
            FastCheck          fc   = new FastCheck();
            PlayClubsPositions pcp  = new PlayClubsPositions();

            bool eventisactive = pcp.PathToGarage();

            if (eventisactive)
            {
                pcp.PrepareToRace(i);//набор/проверка руки
                wait.ReadytoRace();

                bool foundplace = false;
                do
                {
                    se.CarRepair();
                    se.UniversalErrorDefense();
                    se.UnavailableEvent();
                    //se.CardBug();
                    if (fc.ReadyToRace())
                    {
                        Rat.Clk(PointsAndRectangles.startTheRace);
                        Thread.Sleep(2000);
                    }
                    if (fc.EnemyIsReady())
                    {
                        eventisactive = true;
                        foundplace    = true;
                        Thread.Sleep(1000);
                    }
                    if (fc.Bounty())
                    {
                        NotePad.DoLog("эвент закончен");
                        eventisactive = false;
                        foundplace    = true;
                        Thread.Sleep(1000);
                    }
                    if (fc.ClubMap())
                    {
                        NotePad.DoLog("эвент закончен");
                        eventisactive = false;
                        foundplace    = true;
                        Thread.Sleep(1000);
                    }
                } while (!foundplace);//ожидание противника

                if (eventisactive)
                {
                    pcp.TimeToRace(); //расстановка

                    se.EndRace();     //завершение заезда

                    foundplace = false;
                    do
                    {
                        se.UniversalErrorDefense();

                        if (fc.Upgrade())
                        {
                            NotePad.DoLog("реклама на апгрейд");
                            se.UpgradeAdsKiller();
                            Thread.Sleep(1000);
                        }

                        if (fc.Ending())
                        {
                            Rat.Clk(PointsAndRectangles.passTheTableAfterRace);//Table
                            Thread.Sleep(1000);
                        }

                        if (fc.Bounty())
                        {
                            eventisactive = false;
                            foundplace    = true;
                            Thread.Sleep(1000);
                        }

                        if (fc.ControlScreen())
                        {
                            foundplace = true;
                            Thread.Sleep(1000);
                        }

                        if (fc.BugControlScreen())
                        {
                            Thread.Sleep(500);
                            NotePad.DoLog("Bug with Control Screen");
                            Rat.Clk(PointsAndRectangles.backToClubMap);//Back
                            Thread.Sleep(1000);
                        }

                        if (fc.ClubMap())
                        {
                            eventisactive = false;
                            foundplace    = true;
                            Thread.Sleep(1000);
                        }
                    } while (foundplace == false);//переход на экран контроля
                }
            }

            return(eventisactive);
        }