Exemplo n.º 1
0
        public static void RunTest()
        {
            screen = new Screen(Properties.Settings.Default.WindowTitle)
            {
                Interruptible = false
            };
            var sing = new Singularity(screen, "PromotionIV");

            sing.PromotionIV();
            //screen.Wait(Home.LvSample);
            //Combat.SanityCheck.Name = $"Missions/0_2Sanity";
            //screen.Wait(Combat.SanityCheck);
            //screen.Click(new Rectangle(12, 404, 1, 1));
            //screen.Click(Home.CombatButton);
            //var c = new Chapter6(screen, "6_3N");
            //c.Map6_3N();

            //var val = new Valhalla(screen, "1_5V");
            //val.Map1_5V();
            //var c = new Factory(screen);
            //c.Retire3Stars();
            //c.Map6_6();
            //var c = new Combat(screen);
            //c.PrepareMission("6_6");
            //c.ExecuteMission("6_6");

            Trace.WriteLine("Done");
        }
Exemplo n.º 2
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();
            }
        }
Exemplo n.º 3
0
        public FormDebug(Screen screen, Sample sample, Point foundAt, float evaluation)
        {
            InitializeComponent();
            StartPosition = FormStartPosition.Manual;
            var location = Program.form.DesktopLocation;

            Location    = new Point(location.X + 30, location.Y + 30);
            this.screen = screen;
            this.sample = sample;

            labelSearch.Text = sample.Name;
            labelArea.Text   = sample.SearchArea.ToString();
            labelEval.Text   = evaluation.ToString();
            if (foundAt == Point.Empty)
            {
                labelFound.ForeColor = Color.Red;
                labelFound.Text      = "Not Found";
            }
            else
            {
                FoundAt = foundAt;
                //FoundAt = sample.RelativeTo(foundAt);
                labelFound.ForeColor = Color.Black;
                labelFound.Text      = String.Format("X:{0}, Y:{1}", sample.SearchArea.X + foundAt.X, sample.SearchArea.Y + foundAt.Y);
            }
        }
Exemplo n.º 4
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);
            }
        }