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 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);
        }