예제 #1
0
        public Form1()
        {
            InitializeComponent();

            // The requested resolution in 100 ns units:
            int DesiredResolution = 1000;
            // Note: The supported resolutions can be obtained by a call to NtQueryTimerResolution()

            int CurrentResolution = 0;

            // 1. Requesting a higher resolution
            // Note: This call is similar to timeBeginPeriod.
            // However, it to to specify the resolution in 100 ns units.
            if (NtSetTimerResolution(DesiredResolution, true, out CurrentResolution) != 0)
            {
                Console.WriteLine("Setting resolution failed");
            }
            else
            {
                Console.WriteLine("CurrentResolution [100 ns units]: " + CurrentResolution);
            }

            ATimer.ElapsedTimerDelegate callback = timer_Tick;
            timer = new ATimer(3, 1, callback);
            timer.Start();

            _autoIT.AutoItSetOption("SendKeyDelay", 0);

            _autoIT.AutoItSetOption("SendKeyDownDelay", 0);
        }
예제 #2
0
        public Form1()
        {
            InitializeComponent();

            //Load state
            var appSettings = ConfigurationManager.AppSettings;

            if (appSettings.Count != 0)
            {
                pressSpell1Interval = Convert.ToInt32(appSettings["pressSpell1Interval"]);
                pressSpell2Interval = Convert.ToInt32(appSettings["pressSpell2Interval"]);
                pressSpell3Interval = Convert.ToInt32(appSettings["pressSpell3Interval"]);
                pressSpell4Interval = Convert.ToInt32(appSettings["pressSpell4Interval"]);
                pressActiveInterval = Convert.ToInt32(appSettings["pressActiveInterval"]);
                autoKeyOnBool       = Convert.ToBoolean(appSettings["autoKeyOnBool"]);
                active1OnBool       = Convert.ToBoolean(appSettings["active1OnBool"]);
                active2OnBool       = Convert.ToBoolean(appSettings["active2OnBool"]);
                active3OnBool       = Convert.ToBoolean(appSettings["active3OnBool"]);
                active5OnBool       = Convert.ToBoolean(appSettings["active5OnBool"]);
                active6OnBool       = Convert.ToBoolean(appSettings["active6OnBool"]);
                active7OnBool       = Convert.ToBoolean(appSettings["active7OnBool"]);
                wardOnBool          = Convert.ToBoolean(appSettings["wardOnBool"]);
                wardHopOn           = Convert.ToBoolean(appSettings["wardHopOn"]);
                qPreactivateW       = Convert.ToBoolean(appSettings["qPreactivateW"]);
                qPreactivateE       = Convert.ToBoolean(appSettings["qPreactivateE"]);
                qPreactivateR       = Convert.ToBoolean(appSettings["qPreactivateR"]);
                wPreactivateQ       = Convert.ToBoolean(appSettings["wPreactivateQ"]);
                wPreactivateE       = Convert.ToBoolean(appSettings["wPreactivateE"]);
                wPreactivateR       = Convert.ToBoolean(appSettings["wPreactivateR"]);
                ePreactivateQ       = Convert.ToBoolean(appSettings["ePreactivateQ"]);
                ePreactivateW       = Convert.ToBoolean(appSettings["ePreactivateW"]);
                ePreactivateR       = Convert.ToBoolean(appSettings["ePreactivateR"]);
                rPreactivateQ       = Convert.ToBoolean(appSettings["rPreactivateQ"]);
                rPreactivateW       = Convert.ToBoolean(appSettings["rPreactivateW"]);
                rPreactivateE       = Convert.ToBoolean(appSettings["rPreactivateE"]);
                wardHopKey          = Convert.ToChar(appSettings["wardHopKey"]);
                activeKey           = Convert.ToChar(appSettings["activeKey"]);
            }
            qValueText.Text            = pressSpell1Interval.ToString();
            wValueText.Text            = pressSpell2Interval.ToString();
            eValueText.Text            = pressSpell3Interval.ToString();
            rValueText.Text            = pressSpell4Interval.ToString();
            activeValueText.Text       = pressActiveInterval.ToString();
            autoKeyOn.Checked          = autoKeyOnBool;
            active1On.Checked          = active1OnBool;
            active2On.Checked          = active2OnBool;
            active3On.Checked          = active3OnBool;
            active5On.Checked          = active5OnBool;
            active6On.Checked          = active6OnBool;
            active7On.Checked          = active7OnBool;
            wardCheckbox.Checked       = wardOnBool;
            wardHopCheckBox.Checked    = wardHopOn;
            qActivateWCheckBox.Checked = qPreactivateW;
            qActivateECheckBox.Checked = qPreactivateE;
            qActivateRCheckBox.Checked = qPreactivateR;
            wActivateQCheckBox.Checked = wPreactivateQ;
            wActivateECheckBox.Checked = wPreactivateE;
            wActivateRCheckBox.Checked = wPreactivateR;
            eActivateQCheckBox.Checked = ePreactivateQ;
            eActivateWCheckBox.Checked = ePreactivateW;
            eActivateRCheckBox.Checked = ePreactivateR;
            rActivateQCheckBox.Checked = rPreactivateQ;
            rActivateWCheckBox.Checked = rPreactivateW;
            rActivateECheckBox.Checked = rPreactivateE;
            wardHopKeyComboBox.Text    = wardHopKey.ToString();
            activeKeyComboBox.Text     = activeKey.ToString();
            //End load state



            HookManager.KeyDown += HookManager_KeyDown;
            HookManager.KeyUp   += HookManager_KeyUp;

            // The requested resolution in 100 ns units:
            int DesiredResolution = 1000;
            // Note: The supported resolutions can be obtained by a call to NtQueryTimerResolution()

            int CurrentResolution = 0;

            // 1. Requesting a higher resolution
            // Note: This call is similar to timeBeginPeriod.
            // However, it to to specify the resolution in 100 ns units.
            if (NtSetTimerResolution(DesiredResolution, true, out CurrentResolution) != 0)
            {
                Console.WriteLine("Setting resolution failed");
            }
            else
            {
                Console.WriteLine("CurrentResolution [100 ns units]: " + CurrentResolution);
            }

            ATimer.ElapsedTimerDelegate callback = timer_Tick;
            timer = new ATimer(3, 1, callback);
            timer.Start();

            activeKeyComboBox.Text  = "E";
            wardHopKeyComboBox.Text = "Q";

            _autoIT.AutoItSetOption("SendKeyDelay", 0);
            _autoIT1.AutoItSetOption("SendKeyDelay", 0);
            _autoIT2.AutoItSetOption("SendKeyDelay", 0);
            _autoIT3.AutoItSetOption("SendKeyDelay", 0);
            _autoIT4.AutoItSetOption("SendKeyDelay", 0);

            _autoIT.AutoItSetOption("SendKeyDownDelay", 0);
            _autoIT1.AutoItSetOption("SendKeyDownDelay", 0);
            _autoIT2.AutoItSetOption("SendKeyDownDelay", 0);
            _autoIT3.AutoItSetOption("SendKeyDownDelay", 0);
            _autoIT4.AutoItSetOption("SendKeyDownDelay", 0);
        }