public void DragMap()
        {
            FastCheck fc = new FastCheck();

            fc.Bounty();
            Rat.DragnDropSlow(PointsAndRectangles.dragMapS, PointsAndRectangles.dragMapE, 8);
        }
        private void UseFilter(Point cls)
        {
            FastCheck fc = new FastCheck();

            do
            {
                Rat.Clk(PointsAndRectangles.filter);
                Thread.Sleep(1000);
            } while (!fc.FilterIsOpenned());//100% FilterOpenner
            Thread.Sleep(200);
            Rat.Clk(PointsAndRectangles.clear);
            Thread.Sleep(1000);
            Rat.DragnDropSlow(PointsAndRectangles.xy1, PointsAndRectangles.xy2, 8);
            Rat.Clk(PointsAndRectangles.rarity);
            Thread.Sleep(1000);
            Rat.Clk(cls);//выбрать класс
            Thread.Sleep(500);
            Condition.ChooseTyres();
            Thread.Sleep(1000);
            do
            {
                Rat.Clk(PointsAndRectangles.accept);
                Thread.Sleep(500);
            } while (fc.FilterIsOpenned());//100% FilterCloser
            Thread.Sleep(2000);
        }
        public void EndRace()
        {
            FastCheck fc       = new FastCheck();
            int       flag1    = 0;
            int       flag2    = 0;
            int       flag3    = 0;
            bool      nextstep = false;

            do
            {
                if (flag1 > 3 || flag2 > 3 || flag3 > 3)
                {
                    NotePad.DoErrorLog("образовалась петля");
                    RestartBot();
                }
                if (fc.RaceEnd())
                {
                    Rat.Clk(PointsAndRectangles.endOfTheFirstRace); //кнопка "пропустить"
                    flag1++;
                }
                if (fc.AcceptThrow())
                {
                    Rat.Clk(PointsAndRectangles.acceptanceToThrowRaces);//подтвержение "пропуска"
                    flag2++;
                }
                if (fc.WonSet())
                {
                    Rat.Clk(PointsAndRectangles.endOfRaceSet);//звезды
                    flag3++;
                }
                if (fc.LostSet())
                {
                    Rat.Clk(PointsAndRectangles.endOfRaceSet);//звезды
                    flag3++;
                }
                if (fc.DrawSet())
                {
                    Rat.Clk(PointsAndRectangles.endOfRaceSet);//звезды
                    flag3++;
                }
                Thread.Sleep(1500);
                if (fc.Bounty())
                {
                    nextstep = true;
                }
                if (fc.ClubMap())
                {
                    nextstep = true;
                }
                if (fc.Ending())
                {
                    nextstep = true;
                }
                if (fc.Upgrade())
                {
                    nextstep = true;
                }
            } while (!nextstep);
        }
        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 void CheckConnection()
        {
            FastCheck fc = new FastCheck();

            if (fc.TimeIsOut())
            {
                RestartBot();
            }
        }
        public void CarRepair()
        {
            FastCheck fc = new FastCheck();

            if (fc.CarRepair())
            {
                RestartBot();
            }
        }
        public void MissClick()
        {
            FastCheck fc = new FastCheck();

            if (fc.MissClick())
            {
                NotePad.DoLog("Промах");
                Rat.Clk(PointsAndRectangles.missClickCancelation);
                NotePad.DoLog("Исправился");
                Thread.Sleep(1000);
            }
        }
        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);
        }
        public void UniversalErrorDefense()
        {
            FastCheck fc = new FastCheck();

            /*
             * if (fc.FaultNox())
             * {
             *  RestartBot();
             * }*/
            if (fc.ServerError())
            {
                Thread.Sleep(5000);
                if (fc.ServerError())
                {
                    RestartBot();
                }
            }
        }
        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 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();
        }
        public int DragnDpopHand(int n, int uhl, int caCars)
        {
            //caCars - cond available cars
            //n -needed cars
            FastCheck  fc = new FastCheck();
            HandMaking hm = new HandMaking();

            Point[] a          = new Point[] { PointsAndRectangles.pHandSlot1, PointsAndRectangles.pHandSlot2, PointsAndRectangles.pHandSlot3, PointsAndRectangles.pHandSlot4, PointsAndRectangles.pHandSlot5 };
            Point[] b          = new Point[] { PointsAndRectangles.GarageSlot1, PointsAndRectangles.GarageSlot2, PointsAndRectangles.GarageSlot3, PointsAndRectangles.GarageSlot4, PointsAndRectangles.GarageSlot5, PointsAndRectangles.GarageSlot6, PointsAndRectangles.GarageSlot7, PointsAndRectangles.GarageSlot8 };
            int     drag       = 0; //сдвиги
            int     x          = 0; //слот гаража
            int     h          = 0; //слот руки, uhl использованные слоты в предыдущем подборе
            int     neededcars = n;

            while (n > 0)
            {
                if (x == caCars)
                {
                    break;
                } //x имеет значение и при нуле
                else
                {
                    if (x > 3 && drag == 0)
                    {
                        Rat.DragnDropSlow(PointsAndRectangles.ds1, PointsAndRectangles.de1, 5);
                        drag = 1;
                        Thread.Sleep(1000);
                    }//сдвиг

                    if (x > 5 && drag == 1)
                    {
                        Rat.DragnDropSlow(PointsAndRectangles.ds2, PointsAndRectangles.de2, 5);
                        drag = 2;
                        Thread.Sleep(1000);
                    }//сдвиг

                    if (x > 7)
                    {
                        break;
                    }//прерывание цикла в случае множества сломанных

                    if (hm.CarFixed(x))
                    {
                        NotePad.DoLog("Тачка " + (x + 1) + " исправна");
                        while (!fc.ItsGarage())
                        {
                            Thread.Sleep(2000);
                        }
                        Rat.DragnDropSlow(b[x], a[h + uhl], 8);
                        h++;
                        n--;
                    }
                    else
                    {
                        NotePad.DoLog("Тачка " + x + " не готова");
                    }
                    x++;
                }
            }

            int grayslots = fc.CheckHandSlot(uhl + 1, uhl + neededcars);

            NotePad.DoLog(grayslots + " слотов остались пустыми");
            return(grayslots);
        }
示例#13
0
        public bool PathToGarage()
        {
            FastCheck fc           = new FastCheck();
            bool      positionflag = false;
            bool      continuegame = false;

            do
            {
                if (fc.Bounty())
                {
                    NotePad.DoLog("получил награду");
                    positionflag = true;
                }

                if (fc.SeasonIsEnded())
                {
                    Thread.Sleep(500);
                    Rat.Clk(PointsAndRectangles.acceptSeasonEnd);
                    NotePad.DoLog("сезон окончен");
                }

                if (fc.SeasonEndsBounty())
                {
                    Thread.Sleep(500);
                    Rat.Clk(PointsAndRectangles.bountyForSeason);
                    NotePad.DoLog("получил награду за сезон");
                }

                if (fc.ClubMap())
                {
                    Thread.Sleep(2000);

                    if (fc.ClubMap())
                    {
                        NotePad.DoLog("выкинуло на карту");
                        positionflag = true;
                    }
                }

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

                if (fc.CarMenu())
                {
                    Thread.Sleep(500);
                    NotePad.DoLog("Закрываю меню автомобиля");
                    Rat.Clk(PointsAndRectangles.closeCarCard);
                    Thread.Sleep(1000);
                }

                if (fc.ControlScreen())
                {
                    Thread.Sleep(500);
                    NotePad.DoLog("Перехожу в гараж");
                    Rat.Clk(PointsAndRectangles.controlScreenToGarage);//Play
                    Thread.Sleep(1000);
                }

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

                if (fc.ItsGarage())
                {
                    positionflag = true;
                    NotePad.DoLog("Нахожусь в гараже");
                    continuegame = true;
                }
            } while (!positionflag);

            return(continuegame);
        }
        public void MakingHand()
        {
            FastCheck fc = new FastCheck();

            int[] classcars = ConditionHandling();
            NotePad.DoLog("Собираю " + classcars[0] + "F, "
                          + classcars[1] + "E, "
                          + classcars[2] + "D, "
                          + classcars[3] + "C, "
                          + classcars[4] + "B, "
                          + classcars[5] + "A, "
                          + classcars[6] + "S");
            Thread.Sleep(1000);

            int emptycars; //недобор
            int conditionAvailableCars;
            int usedhandslots = 0;

            if (Condition.ConditionNumber1 != "empty" &&
                Condition.ConditionNumber1 != "обычная х3" &&
                !fc.ConditionActivated())
            {
                if (Condition.ConditionNumber2 == "empty")
                {
                    Rat.Clk(PointsAndRectangles.commonCondition);
                }
                else
                {
                    Rat.Clk(PointsAndRectangles.commonCondition);
                    Thread.Sleep(1000);
                    Rat.Clk(PointsAndRectangles.cond1);
                    Thread.Sleep(200);
                    Rat.Clk(PointsAndRectangles.cond2);
                    Thread.Sleep(200);
                    Rat.Clk(PointsAndRectangles.commonConditionCross);
                }
            } //включить фильтр условия события.

            Point[] cls = { PointsAndRectangles.f, PointsAndRectangles.e, PointsAndRectangles.d, PointsAndRectangles.c, PointsAndRectangles.b, PointsAndRectangles.a, PointsAndRectangles.s };
            for (int i = 6; i > -1; i--)
            {
                if (classcars[i] > 0)
                {
                    Randomizer();
                    UseFilter(cls[i]);
                    conditionAvailableCars = Condition.AvailableCars(i);

                    if (i == 0)//для серых нет возврата недобора
                    {
                        DragnDpopHand(classcars[i], usedhandslots, conditionAvailableCars);
                    }
                    else
                    {
                        emptycars         = 0;
                        emptycars        += DragnDpopHand(classcars[i], usedhandslots, conditionAvailableCars);
                        usedhandslots    += classcars[i] - emptycars;
                        classcars[i - 1] += emptycars;
                    }
                }
            }//механизм расстановки

            if (VerifyHand())
            {
                int[] carsid = RememberHand();
                NotePad.Saves(carsid);
            } //сохранение руки
        }
        public void ToClubs()
        {
            bool      needToDragMap = false;
            FastCheck fc            = new FastCheck();
            bool      flag          = false;

            do
            {
                if (fc.NoxRestartMessage())
                {
                    Rat.Clk(PointsAndRectangles.noxRestartMessageAcceptance);
                    Thread.Sleep(1000);
                    Rat.Clk(PointsAndRectangles.edgeOfTheScreen);
                    Thread.Sleep(120000);
                    Process.Start(@"C:\Program Files (x86)\Nox\bin\Nox.exe", "-clone:Nox_1");
                }//nox restart message
                if (fc.StartIcon())//Icon
                {
                    Rat.Clk(PointsAndRectangles.clkTheIcon);
                }
                //if (fc.BrokenInterface()) Rat.Clk(PointsAndRectangles.brokenInterfaceAcceptance);//close notify
                if (fc.LostConnection())
                {
                    Rat.Clk(PointsAndRectangles.reconnectionAfterLostConnection);                     //reconnect
                }
                //if (fc.Google()) Rat.Clk(PointsAndRectangles.googleNotificationAcceptance);//google notify
                if (fc.FBcontinue())
                {
                    Rat.Clk(PointsAndRectangles.fbFucksBrain);                 //fb f***s brain
                }
                if (fc.StartButton())
                {
                    Rat.Clk(PointsAndRectangles.buttonStart);//Start game
                    Thread.Sleep(5000);
                }
                if (fc.HeadPage())
                {
                    Rat.Clk(PointsAndRectangles.toEvents);//Events
                    Thread.Sleep(2000);
                }
                if (fc.DailyBounty())
                {
                    AcceptDailyBounty();
                }
                fc.Bounty();
                if (fc.SeasonEndsBounty())
                {
                    Thread.Sleep(500);
                    Rat.Clk(PointsAndRectangles.seasonEndAcceptance);
                    NotePad.DoLog("получил награду за сезон");
                }
                CheckConnection();
                UniversalErrorDefense();
                if (fc.EventPage())
                {
                    if (fc.InCommonEvent())
                    {
                        Thread.Sleep(500);
                        Rat.Clk(PointsAndRectangles.buttonBack);//back
                    }
                    else
                    {
                        Thread.Sleep(500);
                        Rat.Clk(PointsAndRectangles.toClubs);//Clubs
                        needToDragMap = true;
                    }
                }
                if (fc.ClubMap())
                {
                    flag = true;
                }
                Thread.Sleep(1500);
            } while (!flag);

            if (needToDragMap)
            {
                DragMap();
            }
        }
        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);
        }
示例#17
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);
        }