public static async Task DoSimpleMouseClickAsync(IInteractionProvider provider,
            Coordinates coords, VerticalScaleAlignment valign = VerticalScaleAlignment.Center,
            int buttonDownTimeout = 200)
        {
            var pos = provider.GetCurrentWindowPosition();
            coords = pos.RelativeToAbsoluteCoordinates(pos.ScaleCoordinates(coords,
                ReferenceWindowSize, valign));

            provider.MoveMouse(coords);
            provider.PressMouseButton();
            await provider.WaitAsync(buttonDownTimeout);
            provider.ReleaseMouseButton();
        }
Beispiel #2
0
        public static async Task DoSimpleMouseClickAsync(IInteractionProvider provider,
                                                         Coordinates coords, VerticalScaleAlignment valign = VerticalScaleAlignment.Center,
                                                         int buttonDownTimeout = 150)
        {
            var pos = provider.GetCurrentWindowPosition();

            coords = pos.ScaleCoordinates(coords,
                                          ReferenceWindowSize, valign);

            provider.MoveMouse(coords);
            provider.PressMouseButton();
            await provider.WaitAsync(buttonDownTimeout);

            provider.ReleaseMouseButton();
        }
Beispiel #3
0
        /// <summary>
        /// Clicks on the fishing rod button.
        /// </summary>
        /// <param name="provider"></param>
        /// <returns></returns>
        protected async Task StartCastFishingRodAsync(IInteractionProvider provider)
        {
            var coords = new Coordinates(800, 846);
            var pos    = provider.GetCurrentWindowPosition();

            coords = pos.ScaleCoordinates(coords,
                                          MouseHelpers.ReferenceWindowSize);

            // Move the mouse and press the button.
            provider.MoveMouse(coords);
            provider.PressMouseButton();

            await provider.WaitAsync(300);

            CheckForFishErrorDialog(provider);
        }
        /// <summary>
        /// Clicks on the fishing rod button.
        /// </summary>
        /// <param name="provider"></param>
        /// <returns></returns>
        protected async Task StartCastFishingRodAsync(IInteractionProvider provider)
        {
            Coordinates coords = new Coordinates(800, 846);
            var pos = provider.GetCurrentWindowPosition();
            coords = pos.RelativeToAbsoluteCoordinates(pos.ScaleCoordinates(coords,
                MouseHelpers.ReferenceWindowSize));

            // Move the mouse and press the button.
            provider.MoveMouse(coords);
            provider.PressMouseButton();

            await provider.WaitAsync(300);

            CheckForFishErrorDialog(provider);
        }