예제 #1
0
        public static void Run(string mission, int count)
        {
            ResetCounter();
            screen = new Screen(Properties.Settings.Default.WindowTitle);

            var repair    = new Repair(screen);
            var formation = new Formation(screen);
            var combat    = new Combat(screen);
            var factory   = new Factory(screen);

            bool forcedEnhancement = false;

            for (int i = 0; i != count; i++)
            {
                screen.Interruptible = true;
                screen.Wait(Home.LvSample);
                Thread.Sleep(2000);
                if (screen.Exists(Home.CriticalDamaged))
                {
                    screen.Click(Home.RepairButton);
                    screen.Interruptible = false;
                    repair.RepairCritical();
                    screen.Interruptible = true;
                    screen.Click(Repair.ReturnToBase, Home.LvSample);
                }
                if (Properties.Settings.Default.IsCorpseDragging && !forcedEnhancement)
                {
                    screen.Click(Home.FormationButton);
                    screen.Interruptible = false;
                    formation.ReplaceCorpseDragger();
                    screen.Interruptible = true;
                    screen.Click(Formation.ReturnToBase, Home.LvSample);
                }
                screen.Click(Home.CombatButton);
                while (true)
                {
                    combat.PrepareMission(mission);
                    var missionResult = combat.ExecuteMission(mission);
                    if (missionResult == MissionResult.EnhancementRequired)
                    {
                        forcedEnhancement = true;
                        Thread.Sleep(4000);
                        factory.DollEnhancement();
                        screen.Click(Factory.ReturnButton);
                        break;
                    }
                    if (missionResult == MissionResult.RetirementRequired)
                    {
                        break;
                    }
                    if (Properties.Settings.Default.IsCorpseDragging || missionResult == MissionResult.Finished)
                    {
                        forcedEnhancement = false;
                        screen.Click(Combat.ReturnToBase, Home.LvSample);
                        break;
                    }
                }
                IncreaseCounter();
            }
        }
예제 #2
0
        internal static void LogisticsCheck()
        {
            ResetCounter();
            screen = new Screen(Properties.Settings.Default.WindowTitle);
            screen.Interruptible = true;
            var random    = new Random();
            var refresh   = random.Next(900000, 1800000);
            var stopwatch = Stopwatch.StartNew();

            while (true)
            {
                /*
                 * if (stopwatch.ElapsedMilliseconds > refresh)
                 * {
                 *  screen.Click(Home.FormationButton);
                 *  Thread.Sleep(850);
                 *  screen.Click(Formation.ReturnToBase);
                 *
                 *  stopwatch = Stopwatch.StartNew();
                 *  refresh = random.Next(900000, 1800000);
                 * }
                 */
                if (screen.Exists(Home.LogisticsReturned, 1000))
                {
                    screen.SolveInterruptions();
                }
                if (screen.Exists(Home.ImportantInformation))
                {
                    Thread.Sleep(180000);
                    screen.Click(Home.ImportantInformation);
                    screen.Wait(Home.News);
                    screen.Click(Home.News);
                    screen.Wait(Home.Event);
                    screen.Click(Home.Event);
                }
                Thread.Sleep(20000);
            }
        }