示例#1
0
        //...

        private static void Main(string[] args)
        {
            String path  = @"c:\temp\Password.txt";
            String oPass = File.ReadAllText(path);
            //String ProcWindow = "Logon - Winman Live";

            Process p = Process.Start(@"\\VS02\WinManV7\Live\WinMan.exe");

            p.WaitForInputIdle();
            IntPtr h = p.MainWindowHandle;

            while (p.MainWindowHandle == IntPtr.Zero)
            {
                System.Threading.Thread.Sleep(100);
            }

            if (Control.IsKeyLocked(Keys.CapsLock)) // Checks Capslock is on
            {
                InputSimulator.SimulateKeyDown(VirtualKeyCode.SHIFT);
                //ActivateApp("WinMan.exe");
                ActivateApp("Winman");
                //ActivateApp("Logon - Winman Live");
                InputSimulator.SimulateTextEntry(oPass);
                InputSimulator.SimulateKeyUp(VirtualKeyCode.SHIFT);
            }
            else
            {
                //ActivateApp("WinMan.exe");
                ActivateApp("Winman");
                //ActivateApp("Logon - Winman Live");
                InputSimulator.SimulateTextEntry(oPass);
            }
            InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
        }
示例#2
0
 protected void Paste()
 {
     InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
     InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_V);
     InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_V);
     InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
 }
示例#3
0
        public void SimulateKeyUp()
        {
            if (!_pressed)
            {
                return;
            }

            if (!FakeToggle)
            {
                _pressed = false;
                if (VirtualKey != Keys.NoName)
                {
                    InputSimulator.SimulateKeyUp((VirtualKeyCode)VirtualKey);
                    VirtualKeyUp?.Invoke(this, (VirtualKeyCode)VirtualKey);
                }
                else if (IsAltGrPressed)
                {
                    InputSimulator.SimulateKeyUp(VirtualKeyCode.RMENU);
                    InputSimulator.SimulateKeyUp(VirtualKeyCode.LCONTROL);
                }
                else
                {
                    InputSimulator.SimulateKeyDown(VirtualKeyCode.LCONTROL);
                    InputSimulator.SimulateKeyDown(VirtualKeyCode.RMENU);
                }
            }
        }
示例#4
0
        private void detectBirdwatcher(Joint head, Joint rightHand, Joint rightElbow, Joint rightShoulder)
        {
            //Calculate how far our right hand is from head in both x and y directions
            double deltaX = Math.Abs(rightHand.Position.X - head.Position.X);
            double deltaY = Math.Abs(rightHand.Position.Y - head.Position.Y);

            double headelbowXDifferential = rightElbow.Position.X - head.Position.X;

            if (deltaY < 0.05 &&
                rightHand.Position.Y > rightElbow.Position.Y &&
                rightElbow.Position.Y > rightShoulder.Position.Y &&
                deltaX < 0.3 &&
                headelbowXDifferential > 0.2)
            {
                // Birdwatcher!
                InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_Y); // show augmented reality (twitter layer)
            }
            else
            {
                if (InputSimulator.IsKeyDown(VirtualKeyCode.VK_Y))
                {
                    InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_Y);
                }
            }
        }
示例#5
0
        /// <summary>
        /// Process arm turning. Currently set to fast turn speed only.
        /// </summary>
        /// <param name="shoulder"></param>
        /// <param name="rightHand"></param>
        /// <param name="rightElbow"></param>
        /// <param name="leftHand"></param>
        /// <param name="leftElbow"></param>
        /// <returns></returns>
        private Boolean detectArmTurning(Joint shoulder, Joint rightHand, Joint rightElbow, Joint leftHand, Joint leftElbow)
        {
            double diffHandShoulderRight = Math.Abs(rightHand.Position.Y - shoulder.Position.Y);
            double diffHandShoulderLeft  = Math.Abs(leftHand.Position.Y - shoulder.Position.Y);

            // right hand
            if (diffHandShoulderRight < armTurnThresh && rightHand.Position.X > rightElbow.Position.X)
            {
                InputSimulator.SimulateKeyDown(VirtualKeyCode.OEM_PERIOD);
                return(true);
            }
            // left hand
            else if (diffHandShoulderLeft < armTurnThresh && leftHand.Position.X < leftElbow.Position.X)
            {
                InputSimulator.SimulateKeyDown(VirtualKeyCode.OEM_COMMA);
                return(true);
            }
            // neither right nor left hand
            else
            {
                if (InputSimulator.IsKeyDown(VirtualKeyCode.OEM_PERIOD))
                {
                    InputSimulator.SimulateKeyUp(VirtualKeyCode.OEM_PERIOD);
                }
                if (InputSimulator.IsKeyDown(VirtualKeyCode.OEM_COMMA))
                {
                    InputSimulator.SimulateKeyUp(VirtualKeyCode.OEM_COMMA);
                }
                return(false);
            }
        }
 //GOLF - Swing-A-Long
 public static void swingALong()
 {
     BotFunctions.maximizeAndFocus();
     Thread.Sleep(15000);
     InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
     Thread.Sleep(2340);// 82%
     InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
 }
示例#7
0
        private void executarMagia(VirtualKeyCode enmVirtualKeyCode)
        {
            InputSimulator.SimulateKeyDown(enmVirtualKeyCode);

            this.esperar();

            InputSimulator.SimulateKeyUp(enmVirtualKeyCode);
        }
示例#8
0
 public void SimulateKeyDown()
 {
     if (VirtualKey == Keys.LShiftKey)
     {
         Console.WriteLine("f1");
     }
     if (!FakeToggle)
     {
         if (VirtualKey != Keys.NoName)
         {
             InputSimulator.SimulateKeyDown((VirtualKeyCode)VirtualKey);
             VirtualKeyDown?.Invoke(this, (VirtualKeyCode)VirtualKey);
         }
         else
         {
             InputSimulator.SimulateKeyDown(VirtualKeyCode.LCONTROL);
             InputSimulator.SimulateKeyDown(VirtualKeyCode.RMENU);
         }
         _pressed = true;
     }
     else
     {
         if (!Toggled)
         {
             Toggled          = true;
             ButtonBackground = new SolidColorBrush(Color.FromArgb(120, 255, 255, 255));
             if (VirtualKey != Keys.NoName)
             {
                 InputSimulator.SimulateKeyDown((VirtualKeyCode)VirtualKey);
                 VirtualKeyDown?.Invoke(this, (VirtualKeyCode)VirtualKey);
             }
             else
             {
                 InputSimulator.SimulateKeyDown(VirtualKeyCode.LCONTROL);
                 InputSimulator.SimulateKeyDown(VirtualKeyCode.RMENU);
             }
         }
         else
         {
             Toggled          = false;
             ButtonBackground = Brushes.Transparent;
             if (VirtualKey != Keys.NoName)
             {
                 InputSimulator.SimulateKeyUp((VirtualKeyCode)VirtualKey);
                 VirtualKeyUp?.Invoke(this, (VirtualKeyCode)VirtualKey);
             }
             else
             {
                 InputSimulator.SimulateKeyUp(VirtualKeyCode.RMENU);
                 InputSimulator.SimulateKeyUp(VirtualKeyCode.LCONTROL);
             }
         }
     }
 }
示例#9
0
 // GOLF - Swing Time
 private void button15_Click(object sender, EventArgs e)
 {
     maximizeAndFocus();
     Thread.Sleep(100);
     InputSimulator.SimulateKeyDown(VirtualKeyCode.RIGHT);
     Thread.Sleep(1000);
     InputSimulator.SimulateKeyUp(VirtualKeyCode.RIGHT);
     Thread.Sleep(50);
     InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
     Thread.Sleep(2000);
     InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
 }
示例#10
0
 // GOLF - Seeing green
 private void golfSeeingGreen(object sender, EventArgs e)
 {
     maximizeAndFocus();
     Thread.Sleep(100);
     InputSimulator.SimulateKeyDown(VirtualKeyCode.UP);
     Thread.Sleep(50);
     InputSimulator.SimulateKeyUp(VirtualKeyCode.UP);
     Thread.Sleep(50);
     InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
     Thread.Sleep(1790); // 67%
     InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
 }