Esempio n. 1
0
        private void updateCurrentPositions_Tick(object sender, EventArgs e)
        {
            ///get key states
            short keyStateI  = GetAsyncKeyState(0x49);
            bool  isIPressed = ((keyStateI >> 15) & 0x0001) == 0x0001;

            short keyStateK  = GetAsyncKeyState(0x4B);
            bool  isKPressed = ((keyStateK >> 15) & 0x0001) == 0x0001;

            short keyStateSpace  = GetAsyncKeyState(0x20);
            bool  isSpacePressed = ((keyStateSpace >> 15) & 0x0001) == 0x0001;

            short keyStateF1  = GetAsyncKeyState(0x70);
            bool  isF1Pressed = ((keyStateF1 >> 15) & 0x0001) == 0x0001;

            short keyStateF2  = GetAsyncKeyState(0x51); //This is `Q`, not F2, however i dont care and cant be bothered to rename it
            bool  isF2Pressed = ((keyStateF2 >> 15) & 0x0001) == 0x0001;

            //read current position
            List <float> TmpPos = teleport.readPositon();

            curCords.Text = String.Format("Current: {0} | {1} | {2}", numProc(TmpPos[0]), numProc(TmpPos[1]), numProc(TmpPos[2]));

            ///save current position
            if (isIPressed && GetActiveWindowTitle() == "Teardown")
            {
                List <float> pos = teleport.savePosition();
                savedCords.Text = String.Format("Current: {0} | {1} | {2}", numProc(pos[0]), numProc(pos[1]), numProc(pos[2]));
            }

            ///load saved position
            if (isKPressed && GetActiveWindowTitle() == "Teardown")
            {
                teleport.loadPosition();
            }

            ///use jetpack
            if (isSpacePressed && rbJetpack.Checked)
            {
                jetpack.boost();
            }
            else
            {
                jetpack.first = true;
            }

            if (isF1Pressed)
            {
                if (onceFly)
                {
                    if (isInFly)
                    {
                        fly.endFly();
                        if (lastMovementMode == 1)
                        {
                            rbJetpack.Checked = true;
                        }
                        else
                        {
                            rbNoMovementMod.Checked = true;
                        }
                        isInFly = false;
                    }
                    else
                    {
                        rbFlight.Checked = true;
                        fly.beginFly();
                        isInFly = true;
                    }
                    onceFly = false;
                }
            }
            else
            {
                onceFly = true;
            }

            if (isF2Pressed)
            {
                if (onceSlm)
                {
                    cbGameSpeed.Checked = !cbGameSpeed.Checked;
                    onceSlm             = false;
                }
            }
            else
            {
                onceSlm = true;
            }
        }