Exemplo n.º 1
0
 public static void StopMove()
 {
     _runForwards  = false;
     _runBackwards = false;
     _strafeLeft   = false;
     _strafeRight  = false;
     _rotateLeft   = false;
     _rotateRight  = false;
     _down         = false;
     PushKeys();
     KeyHelper.ReleaseKey("X");
     KeyHelper.ReleaseKey("Space");
 }
Exemplo n.º 2
0
 public static void ReleaseKeys()
 {
     StopMove();
     if (ObjectManager.Initialized)
     {
         KeyHelper.ReleaseKey("Space");
         KeyHelper.ReleaseKey("X");
         KeyHelper.ReleaseKey("Up");
         KeyHelper.ReleaseKey("Down");
         KeyHelper.ReleaseKey("Left");
         KeyHelper.ReleaseKey("Right");
         KeyHelper.ReleaseKey("Q");
         KeyHelper.ReleaseKey("E");
     }
 }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
0
 public static void Down(int milli)
 {
     KeyHelper.PressKey("X");
     Thread.Sleep(milli);
     KeyHelper.ReleaseKey("X");
 }
Exemplo n.º 5
0
 public static void Jump(int milli)
 {
     KeyHelper.PressKey("Space");
     Thread.Sleep(milli);
     KeyHelper.ReleaseKey("Space");
 }