Пример #1
0
        public static void StartSoldierScan()
        {
            //------SQL Query to find Solderiers with wrong Amount---------
            //SELECT* FROM soldaten WHERE anzahl NOT like "%/%" UNION
            //SELECT* FROM soldaten WHERE anzahl like "/%" UNION
            //SELECT* FROM soldaten WHERE anzahl like "%/" UNION
            //SELECT* FROM soldaten WHERE length(anzahl) < 3 UNION
            //SELECT* From soldaten WHERE length(anzahl) = 3 AND substr(anzahl,1,1) > substr(anzahl, -1, 1) UNION
            //SELECT* From soldaten WHERE length(anzahl) = 5 AND substr(anzahl,1,2) > substr(anzahl, -2, 2);

            //-----regex (to filter tables in DB Browser)
            //   / ^/\d +|\d +/$/ findet / x und x/
            //   / ^\d +$/ findet alle die kein / enthalten
            //   / ^[2 - 9] / 1$/

            Dictionary <string, int[]> dicClickPosTyp = new Dictionary <string, int[]>();

            dicClickPosTyp.Add("Sniper", new int[] { -1555, 230 });
            dicClickPosTyp.Add("Sturm", new int[] { -1239, 230 });
            dicClickPosTyp.Add("RPG", new int[] { -1092, 230 });
            dicClickPosTyp.Add("Molotow", new int[] { -951, 230 });
            dicClickPosTyp.Add("Elite", new int[] { -795, 230 });
            dicClickPosTyp.Add("Beschuetzer", new int[] { -649, 230 });
            dicClickPosTyp.Add("Attentaeter", new int[] { -492, 230 });
            dicClickPosTyp.Add("Suppressor", new int[] { -358, 230 });

            Dictionary <string, int[]> dicClickPosStufe = new Dictionary <string, int[]>();

            //dicClickPosStufe.Add("Stern1", new int[] { -1285, 400 });
            //dicClickPosStufe.Add("Stern2", new int[] { -1185, 400 });
            dicClickPosStufe.Add("Stern3", new int[] { -1085, 400 });
            dicClickPosStufe.Add("Stern4", new int[] { -985, 400 });
            dicClickPosStufe.Add("Stern5", new int[] { -885, 400 });
            dicClickPosStufe.Add("Stern6", new int[] { -1285, 500 });
            dicClickPosStufe.Add("Stern7", new int[] { -1185, 500 });
            dicClickPosStufe.Add("Stern8", new int[] { -1085, 500 });
            dicClickPosStufe.Add("Stern9", new int[] { -985, 500 });
            dicClickPosStufe.Add("Stern10", new int[] { -885, 500 });
            dicClickPosStufe.Add("Stern11", new int[] { -1285, 600 });
            //dicClickPosStufe.Add("Stern12", new int[] { -1185, 600 });
            /////////////-pre "Spezial Update"-------
            ////dicClickPosStufe.Add("Stern1", new int[] { -1185, 400 });
            ////dicClickPosStufe.Add("Stern2", new int[] { -1085, 400 });
            //dicClickPosStufe.Add("Stern3", new int[] { -985, 400 });
            //dicClickPosStufe.Add("Stern4", new int[] { -885, 400 });
            //dicClickPosStufe.Add("Stern5", new int[] { -785, 400 });
            //dicClickPosStufe.Add("Stern6", new int[] { -1185, 500 });
            //dicClickPosStufe.Add("Stern7", new int[] { -1085, 500 });
            //dicClickPosStufe.Add("Stern8", new int[] { -985, 500 });
            //dicClickPosStufe.Add("Stern9", new int[] { -885, 500 });
            //dicClickPosStufe.Add("Stern10", new int[] { -785, 500 });
            ////dicClickPosStufe.Add("Stern11", new int[] { -1185, 600 });
            ////dicClickPosStufe.Add("Stern12", new int[] { -1085, 600 });

            Dictionary <string, int[]> dicClickPosKonter = new Dictionary <string, int[]>();

            dicClickPosKonter.Add("RSKommunikation", new int[] { -720, 600 });
            dicClickPosKonter.Add("RSToedlichSpezial", new int[] { -620, 600 });
            dicClickPosKonter.Add("RSRadar", new int[] { -520, 600 });
            dicClickPosKonter.Add("RSBiologischeGefahrSpezial", new int[] { -420, 600 });
            dicClickPosKonter.Add("RSBoot", new int[] { -320, 600 });
            dicClickPosKonter.Add("RSJetpack", new int[] { -220, 600 });
            dicClickPosKonter.Add("RSTarnung", new int[] { -120, 600 });
            dicClickPosKonter.Add("RSVerkleidung", new int[] { -720, 700 });
            dicClickPosKonter.Add("RSHelikopter", new int[] { -620, 700 });
            dicClickPosKonter.Add("RSBootSpezial", new int[] { -520, 700 });
            dicClickPosKonter.Add("RSToedlich", new int[] { -420, 700 });
            dicClickPosKonter.Add("RSGeiseln", new int[] { -320, 700 });
            dicClickPosKonter.Add("RSVIP", new int[] { -220, 700 });
            dicClickPosKonter.Add("RSSprengstoffe", new int[] { -120, 700 });
            dicClickPosKonter.Add("RSTaktiken", new int[] { -720, 800 });
            dicClickPosKonter.Add("RSBegrenzteMunitionSpezial", new int[] { -620, 800 });
            dicClickPosKonter.Add("RSAufklaerung", new int[] { -520, 800 });
            dicClickPosKonter.Add("RSBiologischeGefahr", new int[] { -420, 800 });
            dicClickPosKonter.Add("RSFahrzeug", new int[] { -320, 800 });
            dicClickPosKonter.Add("RSKommunikationSpezial", new int[] { -220, 800 });
            dicClickPosKonter.Add("RSBegrenzteMunition", new int[] { -120, 800 });
            //dicClickPosKonter.Add("OnlySniper", new int[] { }); //Unknown................
            /////////////-pre "Spezial Update"-------
            //dicClickPosKonter.Add("RSKommunikation", new int[] { -620, 600 });
            //dicClickPosKonter.Add("RSRadar", new int[] { -520, 600 });
            //dicClickPosKonter.Add("RSBoot", new int[] { -420, 600 });
            //dicClickPosKonter.Add("RSJetpack", new int[] { -320, 600 });
            //dicClickPosKonter.Add("RSTarnung", new int[] { -220, 600 });
            //dicClickPosKonter.Add("RSVerkleidung", new int[] { -120, 600 });
            //dicClickPosKonter.Add("RSHelikopter", new int[] { -620, 700 });
            //dicClickPosKonter.Add("RSGeiseln", new int[] { -520, 700 });
            //dicClickPosKonter.Add("RSTaktiken", new int[] { -420, 700 });
            //dicClickPosKonter.Add("RSVIP", new int[] { -320, 700 });
            //dicClickPosKonter.Add("RSSprengstoffe", new int[] { -220, 700 });
            //dicClickPosKonter.Add("RSAufklaerung", new int[] { -120, 700 });
            //dicClickPosKonter.Add("RSBiologischeGefahr", new int[] { -620, 800 });
            //dicClickPosKonter.Add("RSFahrzeug", new int[] { -520, 800 });
            //dicClickPosKonter.Add("RSToedlich", new int[] { -420, 800 });
            //dicClickPosKonter.Add("RSBegrenzteMunition", new int[] { -320, 800 });

            Dictionary <string, int[]> dicClickPosBonus = new Dictionary <string, int[]>();

            dicClickPosBonus.Add("BSSchnell", new int[] { -545, 419 });       //20 % speed
            dicClickPosBonus.Add("BSMechaniker", new int[] { -745, 219 });    //20 %speed(bei aktiver drohne) -645, 219
            dicClickPosBonus.Add("BSZeitgewinn", new int[] { -445, 419 });    //10 %speed
            dicClickPosBonus.Add("BSKoordination", new int[] { -445, 219 });  //+10%winrate
            dicClickPosBonus.Add("BSDrohne", new int[] { -745, 419 });        // +10%winrate (bei aktiver drohne)
            dicClickPosBonus.Add("BSImprovisation", new int[] { -345, 319 }); //+5% kleinergleich 2st
            dicClickPosBonus.Add("BSAufsteiger", new int[] { -245, 219 });    //+5% größergleich 4st

            /////////////-pre "Spezial Update"-------
            //dicClickPosBonus.Add("BSSchnell", new int[] { -145, 419 }); //20 % speed
            //dicClickPosBonus.Add("BSMechaniker", new int[] { -645, 219 }); //20 %speed(bei aktiver drohne) -645, 219
            //dicClickPosBonus.Add("BSZeitgewinn", new int[] { -445, 419 }); //10 %speed
            //dicClickPosBonus.Add("BSKoordination", new int[] { -345, 219 }); //+10%winrate
            //dicClickPosBonus.Add("BSDrohne", new int[] { -345, 419 }); // +10%winrate (bei aktiver drohne)
            //dicClickPosBonus.Add("BSImprovisation", new int[] { -245, 319 }); //+5% kleinergleich 2st
            //dicClickPosBonus.Add("BSAufsteiger", new int[] { -145, 219 }); //+5% größergleich 4st

            Dictionary <string, int[]> dicClickPosBonusUnimportant = new Dictionary <string, int[]>();

            dicClickPosBonusUnimportant.Add("BSGepanzert", new int[] { -645, 219 });
            dicClickPosBonusUnimportant.Add("BSSchwere Rüstung", new int[] { -545, 219 });
            dicClickPosBonusUnimportant.Add("BSAbsicherung", new int[] { -345, 219 }); //immun gegen klauen
            dicClickPosBonusUnimportant.Add("BSGeschäftemacher", new int[] { -745, 319 });
            dicClickPosBonusUnimportant.Add("BSÜberlebenskünstler", new int[] { -645, 319 });
            dicClickPosBonusUnimportant.Add("BSÜberlebensspezialist", new int[] { -545, 319 });
            dicClickPosBonusUnimportant.Add("BSGlück", new int[] { -445, 319 });
            dicClickPosBonusUnimportant.Add("BSRabatt", new int[] { -145, 219 });
            dicClickPosBonusUnimportant.Add("BSLehrer", new int[] { -145, 319 });
            dicClickPosBonusUnimportant.Add("BSUnabhängig", new int[] { -245, 319 }); //+5% solo
            dicClickPosBonusUnimportant.Add("BSTechnik", new int[] { -645, 419 });
            /////////////-pre "Spezial Update"-------
            //dicClickPosBonusUnimportant.Add("BSGepanzert", new int[] { -545, 219 });
            //dicClickPosBonusUnimportant.Add("BSSchwere Rüstung", new int[] { -445, 219 });
            //dicClickPosBonusUnimportant.Add("BSAbsicherung", new int[] { -245, 219 }); //immun gegen klauen
            //dicClickPosBonusUnimportant.Add("BSGeschäftemacher", new int[] { -645, 319 });
            //dicClickPosBonusUnimportant.Add("BSÜberlebenskünstler", new int[] { -545, 319 });
            //dicClickPosBonusUnimportant.Add("BSÜberlebensspezialist", new int[] { -445, 319 });
            //dicClickPosBonusUnimportant.Add("BSGlück", new int[] { -345, 319 });
            //dicClickPosBonusUnimportant.Add("BSRabatt", new int[] { -145, 319 });
            //dicClickPosBonusUnimportant.Add("BSLehrer", new int[] { -645, 419 });
            //dicClickPosBonusUnimportant.Add("BSUnabhängig", new int[] { -545, 419 }); //+5% solo
            //dicClickPosBonusUnimportant.Add("BSTechnik", new int[] { -245, 419 });

            WinSystem.WindowActivate(false); //Game won't be started if not allready running
            MainWindow.Sleep(3000);          //Time to get mouse out of VM ;) -> alternativ send Strg+Alt if host = VM

            if (StopSoldierScan == true)
            {
                return;
            }

            int Score = 0;

            if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
            {
                log.Debug("AutoMission interrupted by user at: FirstCheckforFilterMenu");
                StopSoldierScan = true;
                return;
            }
            if (PixelFinder.SearchStaticPixel(1773, 925, "#3A9F64"))
            {
                Score++;
            }                                                                    //FilterButtonGreen
            if (PixelFinder.SearchStaticPixel(1826, 124, "#27597E"))
            {
                Score++;
            }                                                                    //Grey X behind FilterWindow
            if (PixelFinder.SearchStaticPixel(727, 114, "#FFFFFF"))
            {
                Score++;
            }                                                                   //FilterWindowText Filtern >F<ilternach Verfü.
            LoopGarbageCollector.ClearGarbageCollector();
            if (Score >= 2)
            {
                log.Debug("FirstFilterMenu found - start Filtering");
            }
            else
            {
                log.Debug("FirstFilterMenu couldnt be found. Please Navigate into a mission -> filter");
                return;
            }
            int delayInMS = 200;

            delayInMS = Convert.ToInt32(Interaction.InputBox("Enter Scan Delay in milliseconds.", "Scan Delay", "200"));
            void delay()
            {
                MainWindow.Sleep(delayInMS);
            }

            Stopwatch s = Stopwatch.StartNew();

            log.Debug("Stopwatch started. Beginning with foreach");

            int i = 0;

            foreach (KeyValuePair <string, int[]> typ in dicClickPosTyp)
            {
                //log.Debug("foreach typ: " + typ.Key);
                MouseActions.SingleClickAtPosition(-1774, 220);                                             //closes Filter
                delay();
                MouseActions.SingleClickAtPosition(dicClickPosTyp[typ.Key][0], dicClickPosTyp[typ.Key][1]); //selects typ
                delay();
                MouseActions.SingleClickAtPosition(-117, 923);                                              //click FilterMenu

                Score = 0;
                while (Score < 2 && StopSoldierScan == false)
                {
                    Score = 0;

                    if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                    {
                        log.Debug("SoldierScan interrupted by user at: SecondCheckforFilterMenu");
                        StopSoldierScan = true;
                        return;
                    }
                    if (PixelFinder.SearchStaticPixel(1773, 925, "#3A9F64"))
                    {
                        Score++;
                    }                                                                    //FilterButtonGreen
                    if (PixelFinder.SearchStaticPixel(1826, 124, "#27597E"))
                    {
                        Score++;
                    }                                                                    //Grey X behind FilterWindow
                    if (PixelFinder.SearchStaticPixel(727, 114, "#FFFFFF"))
                    {
                        Score++;
                    }                                                                   //FilterWindowText Filtern >F<ilternach Verfü.
                    LoopGarbageCollector.ClearGarbageCollector();
                    if (Score >= 2)
                    {
                        log.Debug("SecondFilterMenu found - continue Filtering");
                    }
                    if (++i > 25)
                    {
                        log.Debug("SecondFilterMenu couldnt be found in time. Current SolderType: " + typ.Key);
                        return;
                    }
                }
                foreach (var stufe in dicClickPosStufe)
                {
                    //log.Debug("foreach stufe: " + stufe.Key);
                    MouseActions.SingleClickAtPosition(dicClickPosStufe[stufe.Key][0], dicClickPosStufe[stufe.Key][1]);
                    delay();
                    foreach (var konter in dicClickPosKonter)
                    {
                        //log.Debug("foreach konter: " + konter.Key);
                        MouseActions.SingleClickAtPosition(dicClickPosKonter[konter.Key][0], dicClickPosKonter[konter.Key][1]);
                        delay();

                        if (stufe.Key != "Stern3")
                        {
                            foreach (var bonus in dicClickPosBonus)
                            {
                                //log.Debug("foreach bonus: " + bonus.Key);
                                if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                                {
                                    log.Debug("SoldierScan interrupted by user at Click Bonus: " + "stufe: " + stufe.Key + " typ: " + typ.Key + " konter: " + konter.Key + " bonus: " + bonus.Key);
                                    StopSoldierScan = true;
                                    return;
                                }

                                MouseActions.SingleClickAtPosition(dicClickPosBonus[bonus.Key][0], dicClickPosBonus[bonus.Key][1]);
                                delay();
                                //log.Debug("start OCR:");
                                string OcrActiveSoldiers = (OCR.OCRcheck(1160, 922, 140, 34, "0123456789/")); //bsp.: 19/25
                                //log.Debug("OcrActiveSoldiers:" + OcrActiveSoldiers);
                                if (OcrActiveSoldiers != "17240")
                                {
                                    if (OcrActiveSoldiers.Length <= 4 && StopSoldierScan == false)
                                    {
                                        log.Debug("Conditions for second Ocr triggered");
                                        OcrActiveSoldiers = (OCR.OCRcheck(1170, 926, 60, 34, "0123456789/")); //bsp.: 19/25
                                        log.Debug("Second OcrActiveSoldiers:" + OcrActiveSoldiers);
                                    }
                                    log.Debug("stufe: " + stufe.Key + " typ: " + typ.Key + " konter: " + konter.Key + " bonus: " + bonus.Key); //+ " Anzahl: " + OcrActiveSoldiers);
                                    if (OcrActiveSoldiers != "0/0" && OcrActiveSoldiers != null && OcrActiveSoldiers != "")
                                    {
                                        CacheDb.InsertScanSoldier(stufe.Key, typ.Key, konter.Key, bonus.Key, OcrActiveSoldiers);
                                    }
                                }
                                MouseActions.SingleClickAtPosition(dicClickPosBonus[bonus.Key][0], dicClickPosBonus[bonus.Key][1]);
                                delay();
                            }

                            foreach (var bonusUnimportant in dicClickPosBonusUnimportant)  //activates every BonusUnimportant
                            //log.Debug("foreach bonus: " + bonus.Key);
                            {
                                if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                                {
                                    log.Debug("SoldierScan interrupted by user at Click Bonus: " + "stufe: " + stufe.Key + " typ: " + typ.Key + " konter: " + konter.Key + " bonus: " + bonusUnimportant.Key);
                                    StopSoldierScan = true;
                                    return;
                                }
                                MouseActions.SingleClickAtPosition(dicClickPosBonusUnimportant[bonusUnimportant.Key][0], dicClickPosBonusUnimportant[bonusUnimportant.Key][1]);
                                delay();
                            }

                            //log.Debug("start OCR:");
                            string OcrActiveSoldiers2 = (OCR.OCRcheck(1160, 922, 140, 34, "0123456789/")); //bsp.: 19/25
                            //log.Debug("OcrActiveSoldiers2:" + OcrActiveSoldiers2);
                            if (OcrActiveSoldiers2 != "17240")
                            {
                                if (OcrActiveSoldiers2.Length <= 4 && StopSoldierScan == false)
                                {
                                    log.Debug("Conditions for second Ocr triggered");
                                    OcrActiveSoldiers2 = (OCR.OCRcheck(1170, 926, 60, 34, "0123456789/")); //bsp.: 19/25
                                    log.Debug("Second OcrActiveSoldiers2:" + OcrActiveSoldiers2);
                                }
                                log.Debug("stufe: " + stufe.Key + " typ: " + typ.Key + " konter: " + konter.Key + " bonus: " + "bonusUnimportant"); //+ " Anzahl: " + OcrActiveSoldiers2);
                                if (OcrActiveSoldiers2 != "0/0" && OcrActiveSoldiers2 != null && OcrActiveSoldiers2 != "")
                                {
                                    CacheDb.InsertScanSoldier(stufe.Key, typ.Key, konter.Key, "bonusUnimportant", OcrActiveSoldiers2);
                                }
                            }

                            foreach (var bonusUnimportant in dicClickPosBonusUnimportant)  //deactivates every BonusUnimportant
                            //log.Debug("foreach bonus: " + bonus.Key);
                            {
                                if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                                {
                                    log.Debug("SoldierScan interrupted by user at Click Bonus: " + "stufe: " + stufe.Key + " typ: " + typ.Key + " konter: " + konter.Key + " bonusUnimportant: " + bonusUnimportant.Key);
                                    StopSoldierScan = true;
                                    return;
                                }
                                MouseActions.SingleClickAtPosition(dicClickPosBonusUnimportant[bonusUnimportant.Key][0], dicClickPosBonusUnimportant[bonusUnimportant.Key][1]);
                                delay();
                            }
                        }
                        else if (stufe.Key == "Stern3")
                        {
                            string OcrActiveSoldiers2 = (OCR.OCRcheck(1160, 922, 140, 34, "0123456789/")); //bsp.: 19/25
                            //log.Debug("OcrActiveSoldiers2:" + OcrActiveSoldiers2);
                            if (OcrActiveSoldiers2 != "17240")
                            {
                                if (OcrActiveSoldiers2.Length <= 4 && StopSoldierScan == false)
                                {
                                    log.Debug("Conditions for second Ocr triggered");
                                    OcrActiveSoldiers2 = (OCR.OCRcheck(1170, 926, 60, 34, "0123456789/")); //bsp.: 19/25
                                    log.Debug("Second OcrActiveSoldiers2:" + OcrActiveSoldiers2);
                                }
                                log.Debug("stufe: " + stufe.Key + " typ: " + typ.Key + " konter: " + konter.Key); //+ " Anzahl: " + OcrActiveSoldiers2);
                                if (OcrActiveSoldiers2 != "0/0" && OcrActiveSoldiers2 != null && OcrActiveSoldiers2 != "")
                                {
                                    CacheDb.InsertScanSoldier(stufe.Key, typ.Key, konter.Key, "bonusInactive", OcrActiveSoldiers2);
                                }
                            }
                        }

                        MouseActions.SingleClickAtPosition(dicClickPosKonter[konter.Key][0], dicClickPosKonter[konter.Key][1]);
                        delay();
                    }

                    MouseActions.SingleClickAtPosition(dicClickPosStufe[stufe.Key][0], dicClickPosStufe[stufe.Key][1]);
                    delay();
                }
                log.Debug("ScanTime: " + typ.Key + " finished in: " + s.Elapsed);
            }
            log.Debug("ScanTime: " + s.Elapsed);
            s.Stop();
        }
Пример #2
0
 private static void DissmissMissingSoldiers()
 {
     StopSoldierDismiss = false;
     if (StopSoldierDismiss == false && CheckforTruppkameradenliste() == 1)
     {
         if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
         {
             log.Debug("Dismissing Soldiers interrupted by user at: CheckforTruppkameradenliste");
             StopSoldierDismiss = true;
             return;
         }
         MouseActions.SingleClickAtPosition(-122, 925); //open Filtermenu
         if (StopSoldierDismiss == false && CheckforFilterScreen() == 1)
         {
             MouseActions.SingleClickAtPosition(-742, 218);  //nicht verfügbar
             MainWindow.Sleep(250);
             MouseActions.SingleClickAtPosition(-551, 611);  // activate 1*
             MainWindow.Sleep(250);
             MouseActions.SingleClickAtPosition(-446, 612);  // activate 2*
             MainWindow.Sleep(250);
             MouseActions.SingleClickAtPosition(-1738, 209); // Close FilterScreen
             MainWindow.Sleep(350);
             int AmountOfLoops = 0;
             while (AmountOfLoops++ < 20)
             {
                 if (AmountOfLoops > 1)
                 {
                     MainWindow.Sleep(300); //time required for SF to reorder soldiers after dissmissing one. Not needet in First round.
                 }
                 if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                 {
                     log.Debug("Dismissing Soldiers interrupted by user at: CheckforTruppkameradenliste");
                     StopSoldierDismiss = true;
                     return;
                 }
                 string[] ImageLocation = ImgSearch.UseImageSearch(MainWindow.ResourcesPath + "berger.png", "140", -1920, 748, 1920, 890);
                 if (StopSoldierDismiss == false && ImageLocation != null && ImageLocation.Length > 0)
                 {
                     int.TryParse(ImageLocation[1], out int x);
                     int.TryParse(ImageLocation[2], out int y);
                     MouseActions.SingleClickAtPosition(x - 100, y - 200); //upperleft corner of picture (which is in the "Bergung" Button) -> to middle of soldier screen
                     if (CheckforSoldierDissmissScreen() == 1)
                     {
                         MainWindow.Sleep(100);
                         MouseActions.SingleClickAtPosition(-1834, 997); // Dissmiss Soldier
                         if (CheckforAcceptDissmissScreen() == 1)
                         {
                             MainWindow.Sleep(100);
                             MouseActions.SingleClickAtPosition(-421, 811); //"Accept" Dismiss Button
                             if (StopSoldierDismiss == false && CheckforTruppkameradenliste() == 1)
                             {
                             }
                             else
                             {
                                 StopSoldierDismiss = true;
                                 return;
                             }
                         }
                         else
                         {
                             StopSoldierDismiss = true;
                             return;
                         }
                     }
                     else
                     {
                         StopSoldierDismiss = true;
                         return;
                     }
                 }
                 else if (StopSoldierDismiss == false && ImageLocation == null)
                 {
                     //scroll 3boosters
                     int i = 0;
                     while (StopSoldierDismiss == false && i < 3)
                     {
                         if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                         {
                             log.Debug("Dismissing Soldiers interrupted by user at: CheckforTruppkameradenliste");
                             StopSoldierDismiss = true;
                             return;
                         }
                         int moveToX = 0;
                         if (MainWindow.CurrentHostName == "VMgr4ndpa" || MainWindow.CurrentHostName == "VMgr4ndpaClone")
                         {
                             MouseActions.SetCursorPos(1868, 484);
                             moveToX = 1715;
                             MouseActions.LeftMouseDown();
                             while (moveToX > 48 && StopSoldierDismiss == false)
                             {
                                 if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                                 {
                                     log.Debug("AutoMission interrupted by user at: selecting Booster");
                                     StopSoldierDismiss = true;
                                     return;
                                 }
                                 moveToX -= 90;
                                 MouseActions.SetCursorPos(moveToX, 484);
                                 MainWindow.Sleep(34);
                             }
                         }
                         else
                         {
                             MouseActions.SetCursorPos(-52, 557);
                             moveToX = -215;
                             MouseActions.LeftMouseDown();
                             while (moveToX > -1872 && StopSoldierDismiss == false)
                             {
                                 if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.LeftAlt) && (Keyboard.IsKeyDown(Key.NumPad0) || Keyboard.IsKeyDown(Key.D0)))
                                 {
                                     log.Debug("AutoMission interrupted by user at: selecting Booster");
                                     StopSoldierDismiss = true;
                                     return;
                                 }
                                 moveToX -= 90;
                                 MouseActions.SetCursorPos(moveToX, 484);
                                 MainWindow.Sleep(34);
                             }
                         }
                         MainWindow.Sleep(150);
                         MouseActions.LeftMouseUp();
                         i++;
                         if (StopSoldierDismiss == false && ImgSearch.UseImageSearch(MainWindow.ResourcesPath + "berger.png", "140", -1920, 748, 1920, 890) != null)
                         {
                             break;
                         }
                         else if (StopSoldierDismiss == true)
                         {
                             return;
                         }
                     }
                 }
                 else if (StopSoldierDismiss == true)
                 {
                     return;
                 }
             }
             log.Debug("Loops finished.");
             StopSoldierDismiss = true;
             return;
         }
         else
         {
             StopSoldierDismiss = true;
             return;
         }
     }
     else
     {
         StopSoldierDismiss = true;
         return;
     }
 }