Пример #1
0
        public ZRSkill()
        {
            zTimer       = new Timer();
            zTimer.Tag   = "zTimer";
            zTimer.Tick += delegate
            {
                if (!frmKOmacro.instance.ApplicationIsActivated())
                {
                    SendInputClass.KeyPress(0x5A);
                    System.Threading.Thread.Sleep(10);
                    SendInputClass.KeyRelease(0x5A);

                    //SendKeys.Send("z");
                }
                //Console.WriteLine("z button pressed. " + zTimer.Interval);
            };
            zTimer.Interval = 100;

            rTimer       = new Timer();
            rTimer.Tag   = "rTimer";
            rTimer.Tick += delegate
            {
                if (!frmKOmacro.instance.ApplicationIsActivated())
                {
                    SendInputClass.KeyPress(0x52);
                    System.Threading.Thread.Sleep(10);
                    SendInputClass.KeyRelease(0x52);

                    //SendKeys.Send("r");
                }
                //Console.WriteLine("r button pressed. " + rTimer.Interval);
            };
            rTimer.Interval = 1000;
        }
Пример #2
0
        public void CreateTimerZ()
        {
            Timer t1 = new Timer();

            t1.Tag   = "Skill Z";
            t1.Tick += delegate
            {
                if (!ApplicationIsActivated())
                {
                    SendInputClass.KeyPress(0x5A);
                    System.Threading.Thread.Sleep(10);
                    SendInputClass.KeyRelease(0x5A);
                }
            };
            Skill skill1 = new Skill(t1);

            skill1.SetSkillActive();
            skills.Add(skill1);
        }
Пример #3
0
        public void CreateTimerSkills()
        {
            for (int ii = 0; ii < 7; ii++)
            {
                Timer t1 = new Timer();
                t1.Tag = "Skill " + (ii + 1);

                string value    = "0x3" + (ii + 1);
                short  hexValue = Convert.ToInt16(value, 16);
                t1.Tick += delegate
                {
                    if (!ApplicationIsActivated())
                    {
                        SendInputClass.KeyPress(hexValue);
                        System.Threading.Thread.Sleep(10);
                        SendInputClass.KeyRelease(hexValue);
                    }
                };
                Skill skill1 = new Skill(t1);
                skills.Add(skill1);
            }

            CreateTimerZ();
        }