Ejemplo n.º 1
0
 /// <summary>
 /// Simulates a specific mouse click on the screen
 /// </summary>
 public void Click(int x, int y, int pause)
 {
     Program.PrintInfo($"Executing click => Name:Random, X:{x}, Y:{y} and wait {pause} milliseconds", Message.Info);
     MouseOperations.SetCursorPosition(x, y);
     MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown);
     Thread.Sleep(10);
     MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftUp);
     Thread.Sleep(pause);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Executes the commands out of the StartGame.json and RestartGame.json
        /// It simulates a mouse click on a specefic position, write a word or
        /// letter if necessary and wait the entered time to execute the following
        /// command out of the json-files.
        /// </summary>
        public void ManagedClick(Click click)
        {
            Program.PrintInfo($"Executing managed click => Name:{click.Name} X:{click.X}, Y:{click.Y} and wait {click.Pause} milliseconds", Message.Info);
            MouseOperations.SetCursorPosition(click.X, click.Y);
            MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown);
            Thread.Sleep(10);
            MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftUp);

            if (click.Word != null)
            {
                KeyOperations.PressKey(click.Word);
            }

            Thread.Sleep(click.Pause);
        }