Exemple #1
0
 public static void Down(int milli)
 {
     KeyHelper.PressKey("X");
     Thread.Sleep(milli);
     KeyHelper.ReleaseKey("X");
 }
Exemple #2
0
        public static void PushKeys()
        {
            if (_oldRunForwards != _runForwards)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_runForwards)
                {
                    KeyHelper.PressKey("Up");
                }
                else
                {
                    KeyHelper.ReleaseKey("Up");
                }
            }
            if (_oldRunBackwards != _runBackwards)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_runBackwards)
                {
                    KeyHelper.PressKey("Down");
                }
                else
                {
                    KeyHelper.ReleaseKey("Down");
                }
            }
            if (_oldDown != _down)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_down)
                {
                    KeyHelper.PressKey("X");
                }
                else
                {
                    KeyHelper.ReleaseKey("X");
                }
            }
            if (_oldStrafeLeft != _strafeLeft)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_strafeLeft)
                {
                    KeyHelper.PressKey("Q");
                }
                else
                {
                    KeyHelper.ReleaseKey("Q");
                }
                //PLazyBot.Scripter.WriteLine("RotateLeft: " + rotateLeft);
            }
            if (_oldStrafeRight != _strafeRight)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_strafeRight)
                {
                    KeyHelper.PressKey("E");
                }
                else
                {
                    KeyHelper.ReleaseKey("E");
                }
                //PLazyBot.Scripter.WriteLine("RotateLeft: " + rotateLeft);
            }
            if (_oldRotateLeft != _rotateLeft)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_rotateLeft)
                {
                    KeyHelper.PressKey("Left");
                }
                else
                {
                    KeyHelper.ReleaseKey("Left");
                }
                //PLazyBot.Scripter.WriteLine("RotateLeft: " + rotateLeft);
            }
            if (_oldRotateRight != _rotateRight)
            {
                KeyT.Wait();
                KeyT.Reset();
                if (_rotateRight)
                {
                    KeyHelper.PressKey("Right");
                }
                else
                {
                    KeyHelper.ReleaseKey("Right");
                }
                //PLazyBot.Scripter.WriteLine("RotateRight: " + rotateRight);
            }

            _oldRunForwards  = _runForwards;
            _oldRunBackwards = _runBackwards;
            _oldStrafeLeft   = _strafeLeft;
            _oldStrafeRight  = _strafeRight;
            _oldRotateLeft   = _rotateLeft;
            _oldRotateRight  = _rotateRight;
            _oldDown         = _down;
        }
Exemple #3
0
 public static void Jump(int milli)
 {
     KeyHelper.PressKey("Space");
     Thread.Sleep(milli);
     KeyHelper.ReleaseKey("Space");
 }