// Clicks auto duel button
 private static void clickAutoDuelButton()
 {
     Cursor.Position = location;
     MouseActions.MouseClick();
     BitmapGraphics.disposeGraphic(tempScreenshot);
     frm.displayText("Clicked on auto-duel.");
     CursorPath.ThawInput();
     frm.changeButtonColor(Color.LightGreen);
     Thread.Sleep(30000);
 }
示例#2
0
 // Clicks for a specified number of times while moving in a specified direction
 private static void clickerLoop(int iterations, int x_shift, int y_shift)
 {
     for (int i = 0; i < iterations; i++)
     {
         location        = new Point(Cursor.Position.X + x_shift, Cursor.Position.Y + y_shift);
         Cursor.Position = location;
         Thread.Sleep(100);
         MouseActions.MouseClick();
     }
 }
        // Click through initial rewards
        private static void clickThroughLevelRewards()
        {
            for (int i = 0; i < 7; i++)
            {
                Thread.Sleep(3000);
                MouseActions.MouseClick();
            }

            Thread.Sleep(3000);

            for (int i = 0; i < 3; i++)
            {
                Thread.Sleep(3000);
                MouseActions.MouseClick();
            }
        }
        // Check for additional character dialog after all clicks
        private static void checkForAdditionalChatDialog()
        {
            tempScreenshot = BitmapGraphics.Screenshot();
            bool secondDialog = BitmapGraphics.FindBitMap(Properties.Resources.bmpBeforeAfterDuel, tempScreenshot, out location);

            if (secondDialog)
            {
                Cursor.Position = location;
                MouseActions.MouseClick();
                BitmapGraphics.disposeGraphic(tempScreenshot);
                Thread.Sleep(4000);
            }
            else
            {
                BitmapGraphics.disposeGraphic(tempScreenshot);
            }
        }
        // Chcecks for an "OK" button that pops up after all character dialogs
        private static void checkForFinalOKButton()
        {
            frm.displayText("Waiting for possible additional dialogs...");
            tempScreenshot = BitmapGraphics.Screenshot();
            bool finalOk = BitmapGraphics.FindBitMap(Properties.Resources.bmpCampReward, tempScreenshot, out location);

            if (finalOk)
            {
                Cursor.Position = location;
                MouseActions.MouseClick();
                BitmapGraphics.disposeGraphic(tempScreenshot);
                Thread.Sleep(2000);
            }
            else
            {
                BitmapGraphics.disposeGraphic(tempScreenshot);
            }
        }
        // Finds auto duel button
        public static void locateAutoDuelButton()
        {
            tempScreenshot = BitmapGraphics.Screenshot();
            MouseActions.MouseClick();
            frm.displayText("Trying to find auto-duel button.");

            if (BitmapGraphics.FindBitMap(Properties.Resources.bmpAutoDuelButton, tempScreenshot, out location))
            {
                clickAutoDuelButton();
            }
            else if (BitmapGraphics.FindBitMap(Properties.Resources.bmpAutoDuelButton2, tempScreenshot, out location))
            {
                clickAutoDuelButton();
            }
            else
            {
                BitmapGraphics.disposeGraphic(tempScreenshot);
                MouseActions.MouseClick();
                Thread.Sleep(3000);
                locateAutoDuelButton();
            }
        }