コード例 #1
0
        private static void Baro_BGW_DoWork(object sender, DoWorkEventArgs e)
        {
            if (Baro_Test4KioskScreen())
            {
                Bitmap BitmapHolder       = Module_Screenshot.SaveScreenshot(false);
                Point  ItemWindowLocation = Baro_Check4Mouseover(ref BitmapHolder);

                if (ItemWindowLocation.X == -1)
                {
                    return;
                }

                string BaroResult = Baro_ReadWindow(ref BitmapHolder, ItemWindowLocation);

                if (Module_Data.PrimeItemsData.ContainsKey(BaroResult))
                {
                    e.Result = new object[] { BaroResult, ItemWindowLocation };
                }
                else
                {
                    Debug.Print(BaroResult);
                }
                BitmapHolder.Dispose();
            }
        }
コード例 #2
0
        public static void Run_RelicScanner()
        {
            if (VoidFissure_Test4RewardsScreen())
            {
                Form_Main._FormReference.Invoke(new Action(() =>
                {
                    if (Form_OverlayRelic._FormReference != null)
                    {
                        Form_OverlayRelic._FormReference.Close();
                    }
                    Form_OverlayRelic._FormReference = new Form_OverlayRelic();
                    Form_OverlayRelic._FormReference.Show();
                }));

                Bitmap BitmapHolder  = Module_Screenshot.SaveScreenshot(true);
                int    RewardCounter = Player_Number == 1 ? VoidFissure_RewardsCount(BitmapHolder) : Player_Number;
                Debug.Print(RewardCounter.ToString());
                VoidFissure_CutScreenshot("1920x1080", BitmapHolder, RewardCounter);

                for (int i = 0; i < RewardCounter; i++)
                {
                    OCR_Results.Add(i.ToString()); //reserve place
                    BackgroundWorker bgworker = new BackgroundWorker();
                    bgworker.DoWork             += RelicBackgroundWorker_DoWork;
                    bgworker.RunWorkerCompleted += RelicBackgroundWorker_RunWorkerCompleted;
                    bgworker.RunWorkerAsync(i);
                }
                BitmapHolder.Dispose();
            }
            else
            {
                if (RunRelicContinuous)
                {
                    Form_Main._FormReference.RelicScan_Timer.Start();
                }
            }
        }